mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-03 03:15:32 -04:00
fix(#887): unit tests, uncommented tests after fix
This commit is contained in:
parent
1ae43bdb90
commit
48dfeb84b0
@ -294,10 +294,7 @@ public class XMLTest {
|
||||
"<euro>A €33</euro>"+
|
||||
"<euroX>A €22€</euroX>"+
|
||||
"<unknown>some text ©</unknown>"+
|
||||
// TODO: Looks like a strictMode regression where embedded single quotes are not handled correctly
|
||||
// Should be fixed.
|
||||
// "<known>" " & ' < ></known>"+
|
||||
"<known>" " & < ></known>"+
|
||||
"<known>" " & ' < ></known>"+
|
||||
"<high>𝄢 𐅥</high>" +
|
||||
"</root>";
|
||||
String expectedStr =
|
||||
@ -306,10 +303,7 @@ public class XMLTest {
|
||||
"\"euro\":\"A €33\"," +
|
||||
"\"euroX\":\"A €22€\"," +
|
||||
"\"unknown\":\"some text ©\"," +
|
||||
// TODO: Looks like a strictMode regression where embedded single quotes are not handled correctly
|
||||
// Should be fixed.
|
||||
// "\"known\":\"\\\" \\\" & ' < >\"," +
|
||||
"\"known\":\"\\\" \\\" & < >\"," +
|
||||
"\"known\":\"\\\" \\\" & ' < >\"," +
|
||||
"\"high\":\"𝄢 𐅥\""+
|
||||
"}}";
|
||||
|
||||
@ -323,12 +317,9 @@ public class XMLTest {
|
||||
*/
|
||||
@Test
|
||||
public void testJsonToXmlEscape(){
|
||||
// TODO: Looks like a strictMode regression where embedded single quotes are not handled correctly
|
||||
// Should be fixed.
|
||||
final String jsonSrc = "{\"amount\":\"10,00 €\","
|
||||
+ "\"description\":\"Ação Válida\u0085\","
|
||||
// + "\"xmlEntities\":\"\\\" ' & < >\""
|
||||
+ "\"xmlEntities\":\"\\\" & < >\""
|
||||
+ "\"xmlEntities\":\"\\\" ' & < >\""
|
||||
+ "}";
|
||||
JSONObject json = new JSONObject(jsonSrc);
|
||||
String xml = XML.toString(json);
|
||||
@ -342,8 +333,7 @@ public class XMLTest {
|
||||
assertTrue("Escaping á failed. Not found in XML output.", xml.contains("á"));
|
||||
// test XML Entities converted
|
||||
assertTrue("Escaping \" failed. Not found in XML output.", xml.contains("""));
|
||||
// TODO: restore when the regression is fixed
|
||||
// assertTrue("Escaping ' failed. Not found in XML output.", xml.contains("'"));
|
||||
assertTrue("Escaping ' failed. Not found in XML output.", xml.contains("'"));
|
||||
assertTrue("Escaping & failed. Not found in XML output.", xml.contains("&"));
|
||||
assertTrue("Escaping < failed. Not found in XML output.", xml.contains("<"));
|
||||
assertTrue("Escaping > failed. Not found in XML output.", xml.contains(">"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user