From: gmungoc Date: Fri, 1 Apr 2016 10:51:02 +0000 (+0100) Subject: JAL-1705 tweak to MapList.toString for debugging X-Git-Tag: Release_2_10_0~270^2~1^2~5 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d6eb02943c3388257841b208e1fb65bd4c0be3b7;p=jalview.git JAL-1705 tweak to MapList.toString for debugging --- diff --git a/src/jalview/util/MapList.java b/src/jalview/util/MapList.java index 8a014c6..e51442c 100644 --- a/src/jalview/util/MapList.java +++ b/src/jalview/util/MapList.java @@ -972,7 +972,9 @@ public class MapList { sb.append(" ").append(Arrays.toString(shift)); } - sb.append(" ] To ["); + sb.append(" ] "); + sb.append(fromRatio).append(":").append(toRatio); + sb.append(" to ["); for (int[] shift : toShifts) { sb.append(" ").append(Arrays.toString(shift)); diff --git a/test/jalview/datamodel/MappingTest.java b/test/jalview/datamodel/MappingTest.java index cbecad5..3131ad7 100644 --- a/test/jalview/datamodel/MappingTest.java +++ b/test/jalview/datamodel/MappingTest.java @@ -66,13 +66,13 @@ public class MappingTest 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()); + assertEquals("[ [1, 6] [8, 13] ] 3:1 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()); + assertEquals("[ [1, 6] [8, 13] ] 3:1 to [ [4, 7] ] Seq1", m.toString()); } } diff --git a/test/jalview/util/MapListTest.java b/test/jalview/util/MapListTest.java index e9bcf24..d4ed0ea 100644 --- a/test/jalview/util/MapListTest.java +++ b/test/jalview/util/MapListTest.java @@ -535,7 +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] ] To [ [51, 1] ]", + assertEquals("[ [1, 5] [10, 15] [25, 20] ] 1:3 to [ [51, 1] ]", s); } @@ -559,7 +559,7 @@ public class MapListTest String s = ml.toString(); assertEquals( - "[ [11, 15] [20, 25] [35, 30] [2, 4] [37, 40] ] To [ [72, 22] [12, 17] [78, 83] [88, 96] ]", + "[ [11, 15] [20, 25] [35, 30] [2, 4] [37, 40] ] 1:3 to [ [72, 22] [12, 17] [78, 83] [88, 96] ]", s); } @@ -572,7 +572,7 @@ public class MapListTest MapList ml2 = new MapList(new int[] { 15, 16 }, new int[] { 58, 53 }, 1, 3); ml.addMapList(ml2); - assertEquals("[ [11, 16] ] To [ [72, 53] ]", ml.toString()); + assertEquals("[ [11, 16] ] 1:3 to [ [72, 53] ]", ml.toString()); } @Test(groups = "Functional")