mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-06 10:45:23 +08:00
Adds testing for unicode entities
This commit is contained in:
@@ -782,11 +782,20 @@ public class XMLTest {
|
||||
XML.toJSONObject("<xml>Can cope &; </xml>").toString());
|
||||
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
|
||||
assertEquals("{\"xml\":\"Can cope <\"}",
|
||||
XML.toJSONObject("<xml>Can cope &lt; </xml>").toString());
|
||||
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; "));
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user