mirror of
https://github.com/ethauvin/JSON-java.git
synced 2025-06-18 00:10:51 -07:00
Adds testing for unicode entities
This commit is contained in:
parent
cb61bbf720
commit
2713f2e2a4
1 changed files with 10 additions and 1 deletions
|
@ -782,11 +782,20 @@ public class XMLTest {
|
||||||
XML.toJSONObject("<xml>Can cope &; </xml>").toString());
|
XML.toJSONObject("<xml>Can cope &; </xml>").toString());
|
||||||
assertEquals("Can cope &; ", XML.unescape("Can cope &; "));
|
assertEquals("Can cope &; ", XML.unescape("Can cope &; "));
|
||||||
|
|
||||||
|
// unicode entity
|
||||||
|
assertEquals("{\"xml\":\"Can cope 4;\"}",
|
||||||
|
XML.toJSONObject("<xml>Can cope 4; </xml>").toString());
|
||||||
|
assertEquals("Can cope 4; ", XML.unescape("Can cope 4; "));
|
||||||
|
|
||||||
// double escaped
|
// double escaped
|
||||||
assertEquals("{\"xml\":\"Can cope <\"}",
|
assertEquals("{\"xml\":\"Can cope <\"}",
|
||||||
XML.toJSONObject("<xml>Can cope &lt; </xml>").toString());
|
XML.toJSONObject("<xml>Can cope &lt; </xml>").toString());
|
||||||
assertEquals("Can cope < ", XML.unescape("Can cope &lt; "));
|
assertEquals("Can cope < ", XML.unescape("Can cope &lt; "));
|
||||||
|
|
||||||
|
assertEquals("{\"xml\":\"Can cope 4\"}",
|
||||||
|
XML.toJSONObject("<xml>Can cope &#x34; </xml>").toString());
|
||||||
|
assertEquals("Can cope 4 ", XML.unescape("Can cope &#x34; "));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue