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/DeepReflectionMatcher.java6
-rw-r--r--src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java9
2 files changed, 10 insertions, 5 deletions
diff --git a/src/test/java/org/zwobble/mammoth/tests/DeepReflectionMatcher.java b/src/test/java/org/zwobble/mammoth/tests/DeepReflectionMatcher.java
index 2d70d3e..72a6529 100644
--- a/src/test/java/org/zwobble/mammoth/tests/DeepReflectionMatcher.java
+++ b/src/test/java/org/zwobble/mammoth/tests/DeepReflectionMatcher.java
@@ -52,11 +52,7 @@ public class DeepReflectionMatcher<T> extends TypeSafeDiagnosingMatcher<T> {
return matchesOptional(path, (Optional)expected, (Optional)actual, mismatchDescription);
}
- if (expected instanceof String) {
- return matchesPrimitive(path, expected, actual, mismatchDescription);
- }
-
- if (expected instanceof Boolean) {
+ if (expected instanceof String || expected instanceof Boolean || expected instanceof Enum) {
return matchesPrimitive(path, expected, actual, mismatchDescription);
}
diff --git a/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java b/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java
index 6a21813..a2e41ea 100644
--- a/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java
+++ b/src/test/java/org/zwobble/mammoth/tests/docx/BodyXmlTests.java
@@ -21,6 +21,7 @@ import static java.util.Arrays.asList;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasProperty;
+import static org.zwobble.mammoth.documents.NoteReference.endnoteReference;
import static org.zwobble.mammoth.documents.NoteReference.footnoteReference;
import static org.zwobble.mammoth.results.Warning.warning;
import static org.zwobble.mammoth.tests.DeepReflectionMatcher.deepEquals;
@@ -345,6 +346,14 @@ public class BodyXmlTests {
}
@Test
+ public void endnoteReferenceHasIdRead() {
+ XmlElement element = element("w:endnoteReference", map("w:id", "4"));
+ assertThat(
+ readSuccess(a(bodyReader), element),
+ deepEquals(endnoteReference("4")));
+ }
+
+ @Test
public void appropriateElementsHaveTheirChildrenReadNormally() {
assertChildrenAreReadNormally("w:ins");
assertChildrenAreReadNormally("w:smartTag");