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/xml/XmlParserTests.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/test/java/org/zwobble/mammoth/tests/xml/XmlParserTests.java b/src/test/java/org/zwobble/mammoth/tests/xml/XmlParserTests.java
index 1b6ee60..ff5072f 100644
--- a/src/test/java/org/zwobble/mammoth/tests/xml/XmlParserTests.java
+++ b/src/test/java/org/zwobble/mammoth/tests/xml/XmlParserTests.java
@@ -58,9 +58,16 @@ public class XmlParserTests {
}
@Test
- public void unmappedNamespaceUrisAreIncludedInBracesAsPrefix() {
+ public void unmappedNamespaceUrisInElementNamesAreIncludedInBracesAsPrefix() {
assertThat(
XmlParser.parseString("<w:body xmlns:w='word'/>"),
is(new XmlElement("{word}body")));
}
+
+ @Test
+ public void unmappedNamespaceUrisInAttributeNamesAreIncludedInBracesAsPrefix() {
+ assertThat(
+ XmlParser.parseString("<body xmlns:w='word' w:name='bob'></body>"),
+ is(new XmlElement("body", ImmutableMap.of("{word}name", "bob"))));
+ }
}