Skip to content

Commit

Permalink
Add missing tests for document matcher parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
mwilliamson committed Jun 13, 2024
1 parent bb5735e commit d3a259e
Showing 1 changed file with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,54 @@ public void readsTableWithStyleName() {
hasTableMatcher(TableMatcher.styleName("Normal Table")));
}

@Test
public void readsBold() {
assertThat(
parseDocumentMatcher("b"),
deepEquals(new StyleMapBuilder().bold(HTML_PATH).build())
);
}

@Test
public void readsItalic() {
assertThat(
parseDocumentMatcher("i"),
deepEquals(new StyleMapBuilder().italic(HTML_PATH).build())
);
}

@Test
public void readsUnderline() {
assertThat(
parseDocumentMatcher("u"),
deepEquals(new StyleMapBuilder().underline(HTML_PATH).build())
);
}

@Test
public void readsStrikethrough() {
assertThat(
parseDocumentMatcher("strike"),
deepEquals(new StyleMapBuilder().strikethrough(HTML_PATH).build())
);
}

@Test
public void readsAllCaps() {
assertThat(
parseDocumentMatcher("all-caps"),
deepEquals(new StyleMapBuilder().allCaps(HTML_PATH).build())
);
}

@Test
public void readsSmallCaps() {
assertThat(
parseDocumentMatcher("small-caps"),
deepEquals(new StyleMapBuilder().smallCaps(HTML_PATH).build())
);
}

private static final HtmlPath HTML_PATH = HtmlPath.element("placeholder");

private StyleMap parseDocumentMatcher(String input) {
Expand Down

0 comments on commit d3a259e

Please sign in to comment.