use of org.eclipse.mylyn.wikitext.toolkit.RecordingDocumentBuilder in project mylyn.docs by eclipse.
the class MediaWikiLanguageTest method testTableIncomplete.
@Test
public void testTableIncomplete() {
final RecordingDocumentBuilder builder = new RecordingDocumentBuilder();
parser.setBuilder(builder);
final String content = "{|\n" + "| Orange || Apple || more\n" + "|-\n" + "| Bread || Pie || more\n" + "|-\n" + "| Butter || Ice cream || and more\n" + "| \n";
parser.parse(content);
for (RecordingDocumentBuilder.Event event : builder.getEvents()) {
if (event.text != null) {
int start = event.locator.getDocumentOffset();
int end = event.locator.getLineSegmentEndOffset() + event.locator.getLineDocumentOffset();
assertEquals(event.text.length(), end - start);
assertTrue(end >= start);
assertEquals(content.substring(start, end), event.text);
}
}
}
Aggregations