From d943fcd0dc04fd4974344eddd13902c89fb595b2 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Thu, 18 Jan 2018 14:27:02 +0000 Subject: [PATCH] JAL-2830 removed toUpperCase() from edited dataset sequence --- src/jalview/commands/EditCommand.java | 2 +- test/jalview/commands/EditCommandTest.java | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/jalview/commands/EditCommand.java b/src/jalview/commands/EditCommand.java index 3f2ace9..1a227c5 100644 --- a/src/jalview/commands/EditCommand.java +++ b/src/jalview/commands/EditCommand.java @@ -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) { diff --git a/test/jalview/commands/EditCommandTest.java b/test/jalview/commands/EditCommandTest.java index 575aae5..2160657 100644 --- a/test/jalview/commands/EditCommandTest.java +++ b/test/jalview/commands/EditCommandTest.java @@ -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()); -- 1.7.10.2