From 4070252a1171f4238dd985010ce25c4f40f56d5c Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 6 Nov 2017 17:47:53 +0000 Subject: [PATCH] JAL-2684 failing test for trim-start -> incorrect pairwise alignment of selected region --- test/jalview/commands/EditCommandTest.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/jalview/commands/EditCommandTest.java b/test/jalview/commands/EditCommandTest.java index 887d3d0..ad033cb 100644 --- a/test/jalview/commands/EditCommandTest.java +++ b/test/jalview/commands/EditCommandTest.java @@ -282,6 +282,28 @@ public class EditCommandTest } /** + * Test replace command when it doesn't cause a sequence edit (see comment in + */ + @Test(groups = { "Functional" }) + public void testReplaceFirstResiduesWithGaps() + { + // test replace when gaps are inserted at start. Start/end should change + // w.r.t. original edited sequence. + SequenceI dsseq = seqs[1].getDatasetSequence(); + new EditCommand("", Action.REPLACE, "----", + new SequenceI[] + { seqs[1] }, 0, 4, al); + // trimmed start + assertEquals("----klmnopq", seqs[1].getSequenceAsString()); + // and ds is preserved + assertTrue(dsseq == seqs[1].getDatasetSequence()); + // and it is unchanged + assertEquals("fghjklmnopq", dsseq.getSequenceAsString()); + // and that alignment sequence start has been adjusted + assertEquals(5, seqs[1].getStart()); + } + + /** * Test that the addEdit command correctly merges insert gap commands when * possible. */ -- 1.7.10.2