Merge develop to Release_2_8_3_Branch
[jalview.git] / test / jalview / util / ShiftListTest.java
1 package jalview.util;
2
3 import static org.junit.Assert.assertEquals;
4 import static org.junit.Assert.assertNull;
5
6 import java.util.Arrays;
7 import java.util.List;
8
9 import org.junit.Test;
10
11 public class ShiftListTest
12 {
13
14   @Test
15   public void testParseMap()
16   {
17     assertNull(ShiftList.parseMap(null));
18     assertNull(ShiftList.parseMap(new int[]
19     {}));
20     
21     /*
22      * Gap map showing residues in aligned positions 2,3,6,8,9,10,12
23      */
24     int[] gm = new int[]
25     { 2, 3, 6, 8, 9, 10, 12 };
26     List<int[]> shifts = ShiftList.parseMap(gm).getShifts();
27     assertEquals(4, shifts.size());
28
29     // TODO are these results (which pass) correct??
30     assertEquals("[0, 2]", Arrays.toString(shifts.get(0)));
31     assertEquals("[4, 2]", Arrays.toString(shifts.get(1)));
32     assertEquals("[7, 1]", Arrays.toString(shifts.get(2)));
33     assertEquals("[11, 1]", Arrays.toString(shifts.get(3)));
34   }
35 }