From: gmungoc Date: Thu, 18 Jun 2015 16:15:23 +0000 (+0100) Subject: JAL-1270 test added X-Git-Tag: Release_2_10_0~599 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=810adc451a7722f687ff48d754c263fe9b2db725;p=jalview.git JAL-1270 test added --- diff --git a/test/jalview/analysis/AlignSeqTest.java b/test/jalview/analysis/AlignSeqTest.java new file mode 100644 index 0000000..ed686a7 --- /dev/null +++ b/test/jalview/analysis/AlignSeqTest.java @@ -0,0 +1,23 @@ +package jalview.analysis; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; + +import org.junit.Test; + +public class AlignSeqTest +{ + @Test + public void testExtractGaps() + { + assertNull(AlignSeq.extractGaps(null, null)); + assertNull(AlignSeq.extractGaps(null, "ACG")); + assertNull(AlignSeq.extractGaps("-. ", null)); + + assertEquals(" AC-G.T", AlignSeq.extractGaps("", " AC-G.T")); + assertEquals("AC-G.T", AlignSeq.extractGaps(" ", " AC-G.T")); + assertEquals("ACG.T", AlignSeq.extractGaps(" -", " AC-G.T")); + assertEquals("ACGT", AlignSeq.extractGaps(" -.", " AC-G.T .")); + assertEquals(" ACG.T", AlignSeq.extractGaps("-", " AC-G.T")); + } +}