Skip to content

Commit 809e569

Browse files
committed
Added test
1 parent 0fec19a commit 809e569

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

‎src/test/java/com/github/underscore/LodashTest.java‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,8 +1163,24 @@ void xmpToJson7() {
11631163
+ " \"#omit-xml-declaration\": \"yes\"\n"
11641164
+ "}",
11651165
U.xmlToJson("<Comment stringValue='a'/>"));
1166-
assertThrows(IllegalArgumentException.class, () -> U.xmlToJson("<Comment stringValue=\"a'/>"));
1167-
assertThrows(IllegalArgumentException.class, () -> U.xmlToJson("<Comment stringValue='a\"/>"));
1166+
assertEquals(
1167+
"{\n"
1168+
+ " \"Comment\": {\n"
1169+
+ " },\n"
1170+
+ " \"#omit-xml-declaration\": \"yes\"\n"
1171+
+ "}",
1172+
U.xmlToJson("<Comment stringValue='a\"'/>"));
1173+
assertEquals(
1174+
"{\n"
1175+
+ " \"Comment\": {\n"
1176+
+ " \"-stringValue\": \"a'\",\n"
1177+
+ " \"-self-closing\": \"true\"\n"
1178+
+ " },\n"
1179+
+ " \"#omit-xml-declaration\": \"yes\"\n"
1180+
+ "}",
1181+
U.xmlToJson("<Comment stringValue=\"a'\"/>"));
1182+
assertThrows(IllegalArgumentException.class, () -> U.xmlToJson("<Comment stringValue=\"a'/>"));
1183+
assertThrows(IllegalArgumentException.class, () -> U.xmlToJson("<Comment stringValue='a\"/>"));
11681184
}
11691185

11701186
@Test

0 commit comments

Comments
 (0)