From 43f5e189cb5cc4aa98932726b17319147c0ae742 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 13 Jun 2024 12:42:41 +0100 Subject: [PATCH] Add missing document matcher parser tests --- .../parsing/DocumentMatcherParsingTests.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/test/java/org/zwobble/mammoth/tests/styles/parsing/DocumentMatcherParsingTests.java b/src/test/java/org/zwobble/mammoth/tests/styles/parsing/DocumentMatcherParsingTests.java index 7c39e78..dc704f1 100644 --- a/src/test/java/org/zwobble/mammoth/tests/styles/parsing/DocumentMatcherParsingTests.java +++ b/src/test/java/org/zwobble/mammoth/tests/styles/parsing/DocumentMatcherParsingTests.java @@ -173,6 +173,50 @@ public void readsHighlightWithColor() { ); } + @Test + public void readsCommentReference() { + assertThat( + parseDocumentMatcher("comment-reference"), + deepEquals(new StyleMapBuilder().commentReference(HTML_PATH).build()) + ); + } + + @Test + public void readsLineBreaks() { + assertThat( + parseDocumentMatcher("br[type='line']"), + deepEquals( + new StyleMapBuilder() + .mapBreak(BreakMatcher.LINE_BREAK, HTML_PATH) + .build() + ) + ); + } + + @Test + public void readsPageBreaks() { + assertThat( + parseDocumentMatcher("br[type='page']"), + deepEquals( + new StyleMapBuilder() + .mapBreak(BreakMatcher.PAGE_BREAK, HTML_PATH) + .build() + ) + ); + } + + @Test + public void readsColumnBreaks() { + assertThat( + parseDocumentMatcher("br[type='column']"), + deepEquals( + new StyleMapBuilder() + .mapBreak(BreakMatcher.COLUMN_BREAK, HTML_PATH) + .build() + ) + ); + } + private static final HtmlPath HTML_PATH = HtmlPath.element("placeholder"); private StyleMap parseDocumentMatcher(String input) {