use of org.eclipse.text.edits.MalformedTreeException in project eclipse.platform.text by eclipse.
the class TextEditTests method testUnconnected1.
@Test
public void testUnconnected1() throws Exception {
MoveSourceEdit s1 = new MoveSourceEdit(3, 1);
boolean exception = false;
try {
fRoot.addChild(s1);
fRoot.apply(fDocument);
} catch (MalformedTreeException e) {
exception = true;
}
assertTrue(exception);
}
use of org.eclipse.text.edits.MalformedTreeException in project eclipse.platform.text by eclipse.
the class TextEditTests method testOverlap7.
@Test
public void testOverlap7() throws Exception {
MoveSourceEdit source = new MoveSourceEdit(2, 5);
MoveTargetEdit target = new MoveTargetEdit(3, source);
fRoot.addChild(source);
boolean exception = false;
try {
fRoot.addChild(target);
} catch (MalformedTreeException e) {
exception = true;
}
assertTrue(exception);
}
use of org.eclipse.text.edits.MalformedTreeException in project eclipse.platform.text by eclipse.
the class TextEditTests method testOverlap8.
@Test
public void testOverlap8() throws Exception {
MoveSourceEdit source = new MoveSourceEdit(2, 5);
MoveTargetEdit target = new MoveTargetEdit(6, source);
fRoot.addChild(source);
boolean exception = false;
try {
fRoot.addChild(target);
} catch (MalformedTreeException e) {
exception = true;
}
assertTrue(exception);
}
use of org.eclipse.text.edits.MalformedTreeException in project eclipse.platform.text by eclipse.
the class TextEditTests method testOverlap6.
@Test
public void testOverlap6() throws Exception {
// [ [] ]
fRoot.addChild(new ReplaceEdit(0, 3, "012"));
boolean exception = false;
try {
fRoot.addChild(new InsertEdit(2, "xx"));
} catch (MalformedTreeException e) {
exception = true;
}
assertTrue(exception);
}
use of org.eclipse.text.edits.MalformedTreeException in project eclipse.platform.text by eclipse.
the class TextEditTests method testOverlap9.
@Test
public void testOverlap9() throws Exception {
MoveSourceEdit s1 = new MoveSourceEdit(3, 1);
MoveTargetEdit t1 = new MoveTargetEdit(7, s1);
MoveSourceEdit s2 = new MoveSourceEdit(2, 3);
MoveTargetEdit t2 = new MoveTargetEdit(8, s2);
fRoot.addChild(s1);
fRoot.addChild(t1);
boolean exception = false;
try {
fRoot.addChild(s2);
fRoot.addChild(t2);
} catch (MalformedTreeException e) {
exception = true;
}
assertTrue(exception);
}
Aggregations