aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/zwobble/mammoth/tests/MammothTests.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/java/org/zwobble/mammoth/tests/MammothTests.java b/src/test/java/org/zwobble/mammoth/tests/MammothTests.java
index b2661b0..4f4c9fd 100644
--- a/src/test/java/org/zwobble/mammoth/tests/MammothTests.java
+++ b/src/test/java/org/zwobble/mammoth/tests/MammothTests.java
@@ -3,6 +3,7 @@ package org.zwobble.mammoth.tests;
import org.junit.Test;
import org.zwobble.mammoth.DocumentConverter;
import org.zwobble.mammoth.Result;
+import org.zwobble.mammoth.internal.styles.parsing.ParseException;
import java.io.File;
import java.io.IOException;
@@ -15,6 +16,7 @@ import static org.junit.Assert.assertThat;
import static org.zwobble.mammoth.internal.util.Lists.list;
import static org.zwobble.mammoth.tests.ResultMatchers.isResult;
import static org.zwobble.mammoth.tests.ResultMatchers.isSuccess;
+import static org.zwobble.mammoth.tests.util.MammothAsserts.assertThrows;
public class MammothTests {
@Test
@@ -190,6 +192,16 @@ public class MammothTests {
}
@Test
+ public void errorIsRaisedIfStyleMapCannotBeParsed() throws IOException {
+ RuntimeException exception = assertThrows(
+ ParseException.class,
+ () -> new DocumentConverter().addStyleMap("p =>\np[style-name=] =>"));
+ assertThat(
+ exception.getMessage(),
+ equalTo("expected token of type STRING but was of type CLOSE_SQUARE_BRACKET"));
+ }
+
+ @Test
public void canDisableDefaultStyleMap() throws IOException {
assertThat(
convertToHtml("simple-list.docx", mammoth -> mammoth.disableDefaultStyleMap()),