aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/zwobble/mammoth/tests/styles/parsing/DocumentMatcherParsingTests.java26
1 files changed, 26 insertions, 0 deletions
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 1af4a86..7c39e78 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
@@ -8,6 +8,8 @@ import org.zwobble.mammoth.internal.styles.parsing.StyleMappingTokeniser;
import org.zwobble.mammoth.internal.styles.parsing.TokenIterator;
import org.zwobble.mammoth.internal.styles.parsing.TokenType;
+import java.util.Optional;
+
import static org.hamcrest.MatcherAssert.assertThat;
import static org.zwobble.mammoth.tests.DeepReflectionMatcher.deepEquals;
@@ -147,6 +149,30 @@ public class DocumentMatcherParsingTests {
);
}
+ @Test
+ public void readsHighlightWithoutColor() {
+ assertThat(
+ parseDocumentMatcher("highlight"),
+ deepEquals(
+ new StyleMapBuilder()
+ .mapHighlight(new HighlightMatcher(Optional.empty()), HTML_PATH)
+ .build()
+ )
+ );
+ }
+
+ @Test
+ public void readsHighlightWithColor() {
+ assertThat(
+ parseDocumentMatcher("highlight[color='yellow']"),
+ deepEquals(
+ new StyleMapBuilder()
+ .mapHighlight(new HighlightMatcher(Optional.of("yellow")), HTML_PATH)
+ .build()
+ )
+ );
+ }
+
private static final HtmlPath HTML_PATH = HtmlPath.element("placeholder");
private StyleMap parseDocumentMatcher(String input) {