From 44efe0e8eeb7651580a2b71950811e64de19209d Mon Sep 17 00:00:00 2001 From: James Procter Date: Mon, 21 Aug 2023 15:46:49 +0100 Subject: [PATCH] JAL-4062 a few more tests to check append honours distinct sequences and doesn't miscount results when it edits the list --- test/jalview/datamodel/SearchResultsTest.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 -- 1.7.10.2