JAL-4062 a few more tests to check append honours distinct sequences and doesn't... patch/JAL-4062_sort_and_merge_contiguousregions
authorJames Procter <j.procter@dundee.ac.uk>
Mon, 21 Aug 2023 14:46:49 +0000 (15:46 +0100)
committerJames Procter <j.procter@dundee.ac.uk>
Mon, 21 Aug 2023 14:46:49 +0000 (15:46 +0100)
test/jalview/datamodel/SearchResultsTest.java

index d8c10ee..8059af9 100644 (file)
@@ -339,7 +339,7 @@ public class SearchResultsTest
   @Test(groups = { "Functional" })
   public void testAppendResult()
   {
-    SequenceI seq1 = new Sequence("", "abcdefghijklm");
+    SequenceI seq1 = new Sequence("", "abcdefghijklm"),seq2=new Sequence("","defdefdefdef");
     SearchResultsI sr = new SearchResults();
     sr.appendResult(seq1, 3, 5);
     assertEquals(1, sr.getCount());
@@ -349,6 +349,19 @@ public class SearchResultsTest
     assertEquals(2, sr.getCount());
     sr.appendResult(seq1, 7, 7);
     assertEquals(1, sr.getCount());
+    sr.appendResult(seq2, 7, 7);
+    assertEquals(2, sr.getCount());
+    sr.appendResult(seq2, 2, 7);
+    assertTrue(sr.appendResult(seq2, 7, 49));
+    assertTrue(sr.appendResult(seq2, 0, 30));
+    assertEquals(2, sr.getCount());
+    int c=0;
+    for (SearchResultMatchI sre: sr.getResults())
+    {
+      c++;
+    }
+    assertEquals(c,2);
+    
   }
   /**
    * Test for method that checks if search results matches a sequence region