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>"+
|
"<euro>A €33</euro>"+
|
||||||
"<euroX>A €22€</euroX>"+
|
"<euroX>A €22€</euroX>"+
|
||||||
"<unknown>some text ©</unknown>"+
|
"<unknown>some text ©</unknown>"+
|
||||||
// TODO: Looks like a strictMode regression where embedded single quotes are not handled correctly
|
"<known>" " & ' < ></known>"+
|
||||||
// Should be fixed.
|
|
||||||
// "<known>" " & ' < ></known>"+
|
|
||||||
"<known>" " & < ></known>"+
|
|
||||||
"<high>𝄢 𐅥</high>" +
|
"<high>𝄢 𐅥</high>" +
|
||||||
"</root>";
|
"</root>";
|
||||||
String expectedStr =
|
String expectedStr =
|
||||||
@ -306,10 +303,7 @@ public class XMLTest {
|
|||||||
"\"euro\":\"A €33\"," +
|
"\"euro\":\"A €33\"," +
|
||||||
"\"euroX\":\"A €22€\"," +
|
"\"euroX\":\"A €22€\"," +
|
||||||
"\"unknown\":\"some text ©\"," +
|
"\"unknown\":\"some text ©\"," +
|
||||||
// TODO: Looks like a strictMode regression where embedded single quotes are not handled correctly
|
"\"known\":\"\\\" \\\" & ' < >\"," +
|
||||||
// Should be fixed.
|
|
||||||
// "\"known\":\"\\\" \\\" & ' < >\"," +
|
|
||||||
"\"known\":\"\\\" \\\" & < >\"," +
|
|
||||||
"\"high\":\"𝄢 𐅥\""+
|
"\"high\":\"𝄢 𐅥\""+
|
||||||
"}}";
|
"}}";
|
||||||
|
|
||||||
@ -323,12 +317,9 @@ public class XMLTest {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testJsonToXmlEscape(){
|
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 €\","
|
final String jsonSrc = "{\"amount\":\"10,00 €\","
|
||||||
+ "\"description\":\"Ação Válida\u0085\","
|
+ "\"description\":\"Ação Válida\u0085\","
|
||||||
// + "\"xmlEntities\":\"\\\" ' & < >\""
|
+ "\"xmlEntities\":\"\\\" ' & < >\""
|
||||||
+ "\"xmlEntities\":\"\\\" & < >\""
|
|
||||||
+ "}";
|
+ "}";
|
||||||
JSONObject json = new JSONObject(jsonSrc);
|
JSONObject json = new JSONObject(jsonSrc);
|
||||||
String xml = XML.toString(json);
|
String xml = XML.toString(json);
|
||||||
@ -342,8 +333,7 @@ public class XMLTest {
|
|||||||
assertTrue("Escaping á failed. Not found in XML output.", xml.contains("á"));
|
assertTrue("Escaping á failed. Not found in XML output.", xml.contains("á"));
|
||||||
// test XML Entities converted
|
// test XML Entities converted
|
||||||
assertTrue("Escaping \" failed. Not found in XML output.", xml.contains("""));
|
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("<"));
|
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