+ @Test(groups = { "Functional" })
+ public void testMatchAdjacent()
+ {
+ SequenceI seq1 = new Sequence("", "abcdefghijklm");
+ SequenceI seq2 = new Sequence("", "abcdefghijklm");
+ SearchResultMatchI m = new SearchResults().new Match(seq1, 2, 5);
+
+ assertTrue(m.adjacent(seq1, 2, 5));
+ assertTrue(m.adjacent(seq1, 3, 5));
+ assertTrue(m.adjacent(seq1, 2, 4));
+ assertTrue(m.adjacent(seq1, 3, 3));
+
+ assertTrue(m.adjacent(seq1, 2, 6));
+ assertTrue(m.adjacent(seq1, 1, 5));
+ assertTrue(m.adjacent(seq1, 1, 8));
+ assertFalse(m.adjacent(seq1, 0, 0));
+ assertFalse(m.adjacent(seq1, 7, 8));
+ assertTrue(m.adjacent(seq1, 6, 8));
+ assertTrue(m.adjacent(seq1, 5, 8));
+ assertTrue(m.adjacent(seq1, 0, 1));
+
+
+ assertFalse(m.adjacent(seq2, 3, 3));
+ assertFalse(m.adjacent(null, 3, 3));
+ }
+