X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=test%2Fjalview%2Futil%2FMapListTest.java;h=9a0bdd723230f6e31b59aec14e32c1b649a691a8;hb=398432781301e21b880be236db2dcc4da89f2b6e;hp=d4ed0ea4a7d78e5492e636fc5438f1899a2a16e1;hpb=d6eb02943c3388257841b208e1fb65bd4c0be3b7;p=jalview.git diff --git a/test/jalview/util/MapListTest.java b/test/jalview/util/MapListTest.java index d4ed0ea..9a0bdd7 100644 --- a/test/jalview/util/MapListTest.java +++ b/test/jalview/util/MapListTest.java @@ -535,8 +535,7 @@ public class MapListTest MapList ml = new MapList(new int[] { 1, 5, 10, 15, 25, 20 }, new int[] { 51, 1 }, 1, 3); String s = ml.toString(); - assertEquals("[ [1, 5] [10, 15] [25, 20] ] 1:3 to [ [51, 1] ]", - s); + assertEquals("[ [1, 5] [10, 15] [25, 20] ] 1:3 to [ [51, 1] ]", s); } @Test(groups = { "Functional" }) @@ -563,6 +562,21 @@ public class MapListTest s); } + /** + * Test that confirms adding a map twice does nothing + */ + @Test(groups = { "Functional" }) + public void testAddMapList_sameMap() + { + MapList ml = new MapList(new int[] { 11, 15, 20, 25, 35, 30 }, + new int[] { 72, 22 }, 1, 3); + String before = ml.toString(); + ml.addMapList(ml); + assertEquals(before, ml.toString()); + ml.addMapList(new MapList(ml)); + assertEquals(before, ml.toString()); + } + @Test(groups = { "Functional" }) public void testAddMapList_contiguous() { @@ -656,8 +670,8 @@ public class MapListTest public void testIsFromForwardStrand() { // [3-9] declares forward strand - MapList ml = new MapList(new int[] { 2, 2, 3, 9, 12, 11 }, - new int[] { 20, 11 }, 1, 1); + MapList ml = new MapList(new int[] { 2, 2, 3, 9, 12, 11 }, new int[] { + 20, 11 }, 1, 1); assertTrue(ml.isFromForwardStrand()); // [11-5] declares reverse strand ([13-14] is ignored)