}
public void runTestWithExtensions(String baseName, int extensions) throws IOException {
String source = getTestResourceAsString(baseName + ".md");
PegDownProcessor processor = new PegDownProcessor(extensions);
RootNode rootNode = processor.parseMarkdown(source.toCharArray());
assertThat("rootNode", rootNode, notNullValue());
final int totalLength = source.length();
MarkdownTokenListBuilder builder = new MarkdownTokenListBuilder(totalLength);
MarkdownLexerVisitor visitor = new MarkdownLexerVisitor(builder);
rootNode.accept(visitor);
List<MarkdownToken> tokens = builder.build();
assertThat(tokens, everyItem(nonZeroLength()));
assertThat(totalLengthOf(tokens), equalTo(totalLength));
}