// 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, "----",
+ EditCommand edit = new EditCommand("", Action.REPLACE, "----",
new SequenceI[]
{ seqs[1] }, 0, 4, al);
// trimmed start
assertEquals("fghjklmnopq", dsseq.getSequenceAsString());
// and that alignment sequence start has been adjusted
assertEquals(5, seqs[1].getStart());
+ AlignmentI[] views = new AlignmentI[] { new Alignment(seqs) };
+ // and undo
+ edit.undoCommand(views);
+
+ // dataset sequence unchanged
+ assertTrue(dsseq == seqs[1].getDatasetSequence());
+ // restore sequence
+ assertEquals("fghjklmnopq", seqs[1].getSequenceAsString());
+ // and start/end numbering also restored
+ assertEquals(1, seqs[1].getStart());
+
}
/**