aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/zwobble/mammoth/tests/styles/StyleMapParserTests.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/org/zwobble/mammoth/tests/styles/StyleMapParserTests.java')
-rw-r--r--src/test/java/org/zwobble/mammoth/tests/styles/StyleMapParserTests.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/java/org/zwobble/mammoth/tests/styles/StyleMapParserTests.java b/src/test/java/org/zwobble/mammoth/tests/styles/StyleMapParserTests.java
index 09f0806..ae2ef2b 100644
--- a/src/test/java/org/zwobble/mammoth/tests/styles/StyleMapParserTests.java
+++ b/src/test/java/org/zwobble/mammoth/tests/styles/StyleMapParserTests.java
@@ -1,4 +1,24 @@
package org.zwobble.mammoth.tests.styles;
+import org.junit.Test;
+import org.zwobble.mammoth.styles.HtmlPath;
+import org.zwobble.mammoth.styles.ParagraphMatcher;
+import org.zwobble.mammoth.styles.StyleMap;
+import org.zwobble.mammoth.styles.parsing.StyleMapParser;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.zwobble.mammoth.tests.DeepReflectionMatcher.deepEquals;
+
public class StyleMapParserTests {
+ @Test
+ public void emptyStringIsParsedAsEmptyStyleMap() {
+ StyleMap styleMap = StyleMapParser.parse("");
+ assertThat(styleMap, deepEquals(StyleMap.builder().build()));
+ }
+
+ @Test
+ public void canMapParagraphs() {
+ StyleMap styleMap = StyleMapParser.parse("p => p");
+ assertThat(styleMap, deepEquals(StyleMap.builder().mapParagraph(ParagraphMatcher.ANY, HtmlPath.EMPTY).build()));
+ }
}