mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-07 03:06:03 +08:00
manual merge of pull request #18
This commit is contained in:
16
XMLTest.java
16
XMLTest.java
@@ -321,4 +321,20 @@ public class XMLTest {
|
||||
|
||||
assertEquals(expected, result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldHandleNullNodeValue()
|
||||
{
|
||||
JSONObject inputJSON = new JSONObject();
|
||||
inputJSON.put("nullValue", JSONObject.NULL);
|
||||
// This is a possible preferred result
|
||||
String expectedXML = "<nullValue/>";
|
||||
String actualXML = "<nullValue>null</nullValue>";
|
||||
/**
|
||||
* This is the current behavior. JSONObject.NULL is emitted as
|
||||
* the string, "null".
|
||||
*/
|
||||
String resultXML = XML.toString(inputJSON);
|
||||
assertEquals(actualXML, resultXML);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user