michael-o commented on code in PR #202:
URL: https://github.com/apache/maven-doxia/pull/202#discussion_r1521244407


##########
doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java:
##########
@@ -798,4 +800,24 @@ public void testQuoteVsApostrophe() throws Exception {
                 "This apostrophe isn't a quote." + "This \u2018quoted 
text\u2019 isn't surrounded by apostrophes.",
                 content.toString());
     }
+
+    @Override
+    protected void assertEventPrefix(Iterator<SinkEventElement> eventIterator) 
{
+        assertSinkStartsWith(eventIterator, "head", "head_", "body");
+    }
+
+    @Override
+    protected void assertEventSuffix(Iterator<SinkEventElement> eventIterator) 
{
+        assertSinkEquals(eventIterator, "body_");
+    }
+
+    @Override
+    protected String getVerbatimSource() {
+        return null; // not supported in MD

Review Comment:
   Indeed, CommonMark does not support this. Eventually a link to 
https://spec.commonmark.org/0.31.2/#fenced-code-blocks might make sense?



##########
doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java:
##########
@@ -146,6 +156,91 @@ public final void testSinkWrapper() throws ParseException, 
IOException {
         }
     }
 
+    /**
+     * Override this method if the parser always emits some static prefix for 
incomplete documents
+     * and consume the prefix related events from the given {@link Iterator}.
+     * @param eventIterator the iterator
+     */
+    protected void assertEventPrefix(Iterator<SinkEventElement> eventIterator) 
{
+        // do nothing by default, i.e. assume no prefix
+    }
+
+    /**
+     * Override this method if the parser always emits some static suffix for 
incomplete documents
+     * and consume the suffix related events from the given {@link Iterator}.
+     * @param eventIterator the iterator
+     */
+    protected void assertEventSuffix(Iterator<SinkEventElement> eventIterator) 
{
+        assertFalse(eventIterator.hasNext(), "didn't expect any further events 
but got at least one");
+    }
+
+    /**
+     * @return markup representing the verbatim text {@value 
#TEXT_WITH_SPECIAL_CHARS} (needs to be properly escaped).
+     * {@code null} can be returned to skip the test for a particular parser.
+     */
+    protected abstract String getVerbatimSource();
+
+    /**
+     * Test a verbatim block (no code) given through {@link 
#getVerbatimSource()}
+     * @throws ParseException
+     */
+    @Test
+    public void testVerbatim() throws ParseException {
+        String source = getVerbatimSource();
+        assumeTrue(source != null, "parser does not support simple verbatim 
text");

Review Comment:
   `assertNotNull()` or similiar?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to