mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-03 03:15:32 -04:00
Adds testing for unicode entities
This commit is contained in:
parent
cb61bbf720
commit
2713f2e2a4
@ -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; "));
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user