JAL-1270 test added
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 18 Jun 2015 16:15:23 +0000 (17:15 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 18 Jun 2015 16:15:23 +0000 (17:15 +0100)
test/jalview/analysis/AlignSeqTest.java [new file with mode: 0644]

diff --git a/test/jalview/analysis/AlignSeqTest.java b/test/jalview/analysis/AlignSeqTest.java
new file mode 100644 (file)
index 0000000..ed686a7
--- /dev/null
@@ -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"));
+  }
+}