From: gmungoc Date: Thu, 21 Jan 2016 14:54:41 +0000 (+0000) Subject: JAL-1705 tests for amended toString X-Git-Tag: Release_2_10_0~296^2~80 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=e6f2452106817f3d57bb7707187e7787d12571d9;p=jalview.git JAL-1705 tests for amended toString --- diff --git a/test/jalview/datamodel/MappingTest.java b/test/jalview/datamodel/MappingTest.java index b0f7fe5..cbecad5 100644 --- a/test/jalview/datamodel/MappingTest.java +++ b/test/jalview/datamodel/MappingTest.java @@ -57,4 +57,22 @@ public class MappingTest assertEquals("[[1, 6], [11, 13], [15, 20]]", result); } + @Test(groups = { "Functional" }) + public void testToString() + { + /* + * with no sequence + */ + MapList fk = new MapList(new int[] { 1, 6, 8, 13 }, new int[] { 4, 7 }, + 3, 1); + Mapping m = new Mapping(fk); + assertEquals("[ [1, 6] [8, 13] ] To [ [4, 7] ] ", m.toString()); + + /* + * with a sequence + */ + SequenceI seq = new Sequence("Seq1", ""); + m = new Mapping(seq, fk); + assertEquals("[ [1, 6] [8, 13] ] To [ [4, 7] ] Seq1", m.toString()); + } }