JAL-2830 removed toUpperCase() from edited dataset sequence
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 18 Jan 2018 14:27:02 +0000 (14:27 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 18 Jan 2018 14:27:02 +0000 (14:27 +0000)
src/jalview/commands/EditCommand.java
test/jalview/commands/EditCommandTest.java

index 3f2ace9..1a227c5 100644 (file)
@@ -837,7 +837,7 @@ public class EditCommand implements CommandI
             // old ds and edited ds are different, so
             // create the new dataset sequence
             SequenceI newds = new Sequence(oldds);
-            newds.setSequence(fullseq.toUpperCase());
+            newds.setSequence(fullseq);
 
             if (command.oldds == null)
             {
index 575aae5..2160657 100644 (file)
@@ -279,9 +279,14 @@ public class EditCommandTest
   {
     // seem to need a dataset sequence on the edited sequence here
     seqs[1].createDatasetSequence();
-    new EditCommand("", Action.REPLACE, "ZXY", new SequenceI[] { seqs[1] },
+    assertEquals("fghjklmnopq", seqs[1].getSequenceAsString());
+    // NB command.number holds end position for a Replace command
+    new EditCommand("", Action.REPLACE, "Z-xY", new SequenceI[] { seqs[1] },
             4, 8, al);
     assertEquals("abcdefghjk", seqs[0].getSequenceAsString());
+    assertEquals("fghjZ-xYopq", seqs[1].getSequenceAsString());
+    assertEquals("fghjZxYopq",
+            seqs[1].getDatasetSequence().getSequenceAsString());
     assertEquals("qrstuvwxyz", seqs[2].getSequenceAsString());
     assertEquals("1234567890", seqs[3].getSequenceAsString());
   }
@@ -303,14 +308,15 @@ public class EditCommandTest
      * NB arg4 = start column of selection for edit (base 0)
      * arg5 = column after end of selection for edit
      */
-    EditCommand edit = new EditCommand("", Action.REPLACE, "XYZ",
+    EditCommand edit = new EditCommand("", Action.REPLACE, "xyZ",
             new SequenceI[]
             { seq }, 2,
             4, al);
-    assertEquals("ABXYZ-DEF", seq.getSequenceAsString());
+    assertEquals("ABxyZ-DEF", seq.getSequenceAsString());
     assertEquals(1, seq.getStart());
     assertEquals(8, seq.getEnd());
-    assertEquals("ABXYZDEF", seq.getDatasetSequence().getSequenceAsString());
+    assertEquals("ABxyZDEF",
+            seq.getDatasetSequence().getSequenceAsString());
     assertEquals(8, seq.getDatasetSequence().getEnd());
 
     /*
@@ -331,10 +337,10 @@ public class EditCommandTest
      */
     edit.doCommand(views);
 
-    assertEquals("ABXYZ-DEF", seq.getSequenceAsString());
+    assertEquals("ABxyZ-DEF", seq.getSequenceAsString());
     assertEquals(1, seq.getStart());
     assertEquals(8, seq.getEnd());
-    assertEquals("ABXYZDEF",
+    assertEquals("ABxyZDEF",
             seq.getDatasetSequence().getSequenceAsString());
     assertEquals(8, seq.getDatasetSequence().getEnd());