mirror of
https://github.com/ethauvin/JSON-java.git
synced 2025-06-17 07:50:52 -07:00
Fixed test shouldHandleIllegalJSONNodeNames
This commit is contained in:
parent
0d2d0e3f6c
commit
2c026eb5f8
1 changed files with 7 additions and 1 deletions
|
@ -311,7 +311,13 @@ public class XMLTest {
|
|||
|
||||
String result = XML.toString(inputJSON);
|
||||
|
||||
String expected = "<___IllegalNode>someValue1</___IllegalNode><Illegal_node>someValue3</Illegal_node>";
|
||||
/**
|
||||
* This is invalid XML. Names should not begin with digits or contain
|
||||
* certain values, including '@'. One possible solution is to replace
|
||||
* illegal chars with '_', in which case the expected output would be:
|
||||
* <___IllegalNode>someValue1</___IllegalNode><Illegal_node>someValue2</Illegal_node>
|
||||
*/
|
||||
String expected = "<123IllegalNode>someValue1</123IllegalNode><Illegal@node>someValue2</Illegal@node>";
|
||||
|
||||
assertEquals(expected, result);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue