use of org.eclipse.text.edits.MalformedTreeException in project eclipse.platform.text by eclipse.
the class TextEditTests method testOverlap2.
@Test
public void testOverlap2() throws Exception {
// [[ ] ]
fRoot.addChild(new ReplaceEdit(0, 2, "01"));
boolean exception = false;
try {
fRoot.addChild(new ReplaceEdit(0, 1, "0"));
} 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 testBufferLength.
@Test
public void testBufferLength() throws Exception {
MultiTextEdit edit = new MultiTextEdit(0, fDocument.getLength() + 1);
boolean exception = false;
try {
fRoot.addChild(edit);
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 testOverlap4.
@Test
public void testOverlap4() throws Exception {
// [ [ ] ]
fRoot.addChild(new ReplaceEdit(0, 3, "012"));
boolean exception = false;
try {
fRoot.addChild(new ReplaceEdit(1, 1, "1"));
} 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 testOverlap5.
@Test
public void testOverlap5() throws Exception {
// [ [] ]
fRoot.addChild(new ReplaceEdit(0, 3, "012"));
boolean exception = false;
try {
fRoot.addChild(new InsertEdit(1, "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 testOverlap3.
@Test
public void testOverlap3() throws Exception {
// [ [ ]]
fRoot.addChild(new ReplaceEdit(0, 2, "01"));
boolean exception = false;
try {
fRoot.addChild(new ReplaceEdit(1, 1, "1"));
} catch (MalformedTreeException e) {
exception = true;
}
assertTrue(exception);
}
Aggregations