X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=blobdiff_plain;f=test%2Fjalview%2Fio%2FEmblFlatFileTest.java;h=4b5afa7c42bea360a02b1fe13816f678528cda54;hp=7775c8f3c10c0da55da7f71f889f719688113ec0;hb=07cb43d5a1e477b16582f98519343c162d7428ef;hpb=08c7bee16c16563cc7cec7ea4d336b3e0c4c937a diff --git a/test/jalview/io/EmblFlatFileTest.java b/test/jalview/io/EmblFlatFileTest.java index 7775c8f..4b5afa7 100644 --- a/test/jalview/io/EmblFlatFileTest.java +++ b/test/jalview/io/EmblFlatFileTest.java @@ -329,21 +329,23 @@ public class EmblFlatFileTest // exact length match: assertSame(exons, EmblFlatFile.adjustForProteinLength(6, exons)); - // match if we assume exons include stop codon not in protein: - assertSame(exons, EmblFlatFile.adjustForProteinLength(5, exons)); - + // patch from JAL-3725 in EmblXmlSource propagated to Flatfile + // match if we assume exons include stop codon not in protein: + int[] truncated = EmblFlatFile.adjustForProteinLength(5, exons); + assertEquals(Arrays.toString(truncated), "[11, 15, 21, 25, 31, 35]"); + // truncate last exon by 6bp - int[] truncated = EmblFlatFile.adjustForProteinLength(4, exons); - assertEquals("[11, 15, 21, 25, 31, 32]", Arrays.toString(truncated)); + truncated = EmblFlatFile.adjustForProteinLength(4, exons); + assertEquals(Arrays.toString(truncated),"[11, 15, 21, 25, 31, 32]"); // remove last exon and truncate preceding by 1bp (so 3bp in total) truncated = EmblFlatFile.adjustForProteinLength(3, exons); - assertEquals("[11, 15, 21, 24]", Arrays.toString(truncated)); + assertEquals(Arrays.toString(truncated),"[11, 15, 21, 24]"); // exact removal of exon case: exons = new int[] { 11, 15, 21, 27, 33, 38 }; // 18 bp truncated = EmblFlatFile.adjustForProteinLength(4, exons); - assertEquals("[11, 15, 21, 27]", Arrays.toString(truncated)); + assertEquals(Arrays.toString(truncated), "[11, 15, 21, 27]"); // what if exons are too short for protein? truncated = EmblFlatFile.adjustForProteinLength(7, exons);