From: James Procter Date: Mon, 21 Aug 2023 14:46:49 +0000 (+0100) Subject: JAL-4062 a few more tests to check append honours distinct sequences and doesn't... X-Git-Tag: Release_2_11_4_0~141^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=44efe0e8eeb7651580a2b71950811e64de19209d;p=jalview.git JAL-4062 a few more tests to check append honours distinct sequences and doesn't miscount results when it edits the list --- diff --git a/test/jalview/datamodel/SearchResultsTest.java b/test/jalview/datamodel/SearchResultsTest.java index d8c10ee..8059af9 100644 --- a/test/jalview/datamodel/SearchResultsTest.java +++ b/test/jalview/datamodel/SearchResultsTest.java @@ -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