
org.commonmark.test.RenderingTestCase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commonmark-test-util Show documentation
Show all versions of commonmark-test-util Show documentation
commonmark-java classes for tests
package org.commonmark.test;
import static org.junit.Assert.assertEquals;
public abstract class RenderingTestCase {
protected abstract String render(String source);
protected void assertRendering(String source, String expectedHtml) {
String html = render(source);
// include source for better assertion errors
String expected = showTabs(expectedHtml + "\n\n" + source);
String actual = showTabs(html + "\n\n" + source);
assertEquals(expected, actual);
}
private static String showTabs(String s) {
// Tabs are shown as "rightwards arrow" for easier comparison
return s.replace("\t", "\u2192");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy