Skip to content

Commit

Permalink
Add missing document matcher parser tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mwilliamson committed Jun 13, 2024
1 parent a26168d commit 43f5e18
Showing 1 changed file with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 43f5e18

Please sign in to comment.