harness.checkPoint("testPositions");
PlainDocument d = new PlainDocument();
try
{
d.insertString(0, "ABCDEF", null);
Position p0 = d.createPosition(0);
harness.check(p0.getOffset(), 0);
Position p1 = d.createPosition(1);
harness.check(p1.getOffset(), 1);
Position p2 = d.createPosition(2);
harness.check(p2.getOffset(), 2);
Position p3 = d.createPosition(3);
harness.check(p3.getOffset(), 3);
Position p4 = d.createPosition(4);
harness.check(p4.getOffset(), 4);
Position p5 = d.createPosition(5);
harness.check(p5.getOffset(), 5);
Position p6 = d.createPosition(6);
harness.check(p6.getOffset(), 6);
d.remove(2, 2);
harness.check(p0.getOffset(), 0);
harness.check(p1.getOffset(), 1);
harness.check(p2.getOffset(), 2);
harness.check(p3.getOffset(), 2);
harness.check(p4.getOffset(), 2);
harness.check(p5.getOffset(), 3);
harness.check(p6.getOffset(), 4);
d.remove(0, 1);
harness.check(p0.getOffset(), 0);
harness.check(p1.getOffset(), 0);
harness.check(p2.getOffset(), 1);
harness.check(p3.getOffset(), 1);
harness.check(p4.getOffset(), 1);
harness.check(p5.getOffset(), 2);
harness.check(p6.getOffset(), 3);
}
catch (BadLocationException e)
{
}