@@ -294,10 +294,7 @@ public void testXmlEscapeToJson(){
294
294
"<euro>A €33</euro>" +
295
295
"<euroX>A €22€</euroX>" +
296
296
"<unknown>some text ©</unknown>" +
297
- // TODO: Looks like a strictMode regression where embedded single quotes are not handled correctly
298
- // Should be fixed.
299
- // "<known>" " & ' < ></known>"+
300
- "<known>" " & < ></known>" +
297
+ "<known>" " & ' < ></known>" +
301
298
"<high>𝄢 𐅥</high>" +
302
299
"</root>" ;
303
300
String expectedStr =
@@ -306,10 +303,7 @@ public void testXmlEscapeToJson(){
306
303
"\" euro\" :\" A €33\" ," +
307
304
"\" euroX\" :\" A €22€\" ," +
308
305
"\" unknown\" :\" some text ©\" ," +
309
- // TODO: Looks like a strictMode regression where embedded single quotes are not handled correctly
310
- // Should be fixed.
311
- // "\"known\":\"\\\" \\\" & ' < >\"," +
312
- "\" known\" :\" \\ \" \\ \" & < >\" ," +
306
+ "\" known\" :\" \\ \" \\ \" & ' < >\" ," +
313
307
"\" high\" :\" 𝄢 𐅥\" " +
314
308
"}}" ;
315
309
@@ -323,12 +317,9 @@ public void testXmlEscapeToJson(){
323
317
*/
324
318
@ Test
325
319
public void testJsonToXmlEscape (){
326
- // TODO: Looks like a strictMode regression where embedded single quotes are not handled correctly
327
- // Should be fixed.
328
320
final String jsonSrc = "{\" amount\" :\" 10,00 €\" ,"
329
321
+ "\" description\" :\" Ação Válida\u0085 \" ,"
330
- // + "\"xmlEntities\":\"\\\" ' & < >\""
331
- + "\" xmlEntities\" :\" \\ \" & < >\" "
322
+ + "\" xmlEntities\" :\" \\ \" ' & < >\" "
332
323
+ "}" ;
333
324
JSONObject json = new JSONObject (jsonSrc );
334
325
String xml = XML .toString (json );
@@ -342,8 +333,7 @@ public void testJsonToXmlEscape(){
342
333
assertTrue ("Escaping á failed. Not found in XML output." , xml .contains ("á" ));
343
334
// test XML Entities converted
344
335
assertTrue ("Escaping \" failed. Not found in XML output." , xml .contains (""" ));
345
- // TODO: restore when the regression is fixed
346
- // assertTrue("Escaping ' failed. Not found in XML output.", xml.contains("'"));
336
+ assertTrue ("Escaping ' failed. Not found in XML output." , xml .contains ("'" ));
347
337
assertTrue ("Escaping & failed. Not found in XML output." , xml .contains ("&" ));
348
338
assertTrue ("Escaping < failed. Not found in XML output." , xml .contains ("<" ));
349
339
assertTrue ("Escaping > failed. Not found in XML output." , xml .contains (">" ));
0 commit comments