JAL-2738 unit test for mapping failure case
[jalview.git] / test / jalview / util / MapListTest.java
index f3395ca..d2db258 100644 (file)
@@ -931,5 +931,13 @@ public class MapListTest
     toRanges = compound.getToRanges();
     assertEquals(toRanges.size(), 1);
     assertArrayEquals(new int[] { 47, 50, 71, 126 }, toRanges.get(0));
+
+    /*
+     * method returns null if not all regions are mapped through
+     */
+    ml1 = new MapList(new int[] { 1, 50 }, new int[] { 101, 150 }, 1, 1);
+    ml2 = new MapList(new int[] { 131, 180 }, new int[] { 201, 250 }, 1, 3);
+    compound = ml1.traverse(ml2);
+    assertNull(compound);
   }
 }