aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/zwobble/mammoth/tests/xml/XmlParserTests.java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-09-26 17:39:28 +0100
committerMichael Williamson <mike@zwobble.org>2015-09-26 17:39:28 +0100
commite0cf7240fe37c5f44b66563db29c07bc1188805b (patch)
treede1819d6df14e660bc723d2d49e550b60ff32fcf /src/test/java/org/zwobble/mammoth/tests/xml/XmlParserTests.java
parentb407cc0db579ccf96a023e7cafd2672f507a1b89 (diff)
Add test for attribute names with URIs
Diffstat (limited to 'src/test/java/org/zwobble/mammoth/tests/xml/XmlParserTests.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"))));
+ }
}