mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-10 04:24:31 +08:00
fix(#887): regressions, unit tests
- JSONArray now evaluates EOF accordingly for empty Array inputs. - JSONTokener fixed indentation - externalized two JSONMLTest cases
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
[
|
||||
"addresses",
|
||||
{
|
||||
"xsi:noNamespaceSchemaLocation": "test.xsd",
|
||||
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance"
|
||||
},
|
||||
[
|
||||
"address",
|
||||
{
|
||||
"addrType": "my address"
|
||||
},
|
||||
[
|
||||
"name",
|
||||
{
|
||||
"nameType": "my name"
|
||||
},
|
||||
"Joe Tester"
|
||||
],
|
||||
[
|
||||
"street",
|
||||
"Baker street 5"
|
||||
],
|
||||
[
|
||||
"NothingHere",
|
||||
{
|
||||
"except": "an attribute"
|
||||
}
|
||||
],
|
||||
[
|
||||
"TrueValue",
|
||||
true
|
||||
],
|
||||
[
|
||||
"FalseValue",
|
||||
false
|
||||
],
|
||||
[
|
||||
"NullValue",
|
||||
null
|
||||
],
|
||||
[
|
||||
"PositiveValue",
|
||||
42
|
||||
],
|
||||
[
|
||||
"NegativeValue",
|
||||
-23
|
||||
],
|
||||
[
|
||||
"DoubleValue",
|
||||
-23.45
|
||||
],
|
||||
[
|
||||
"Nan",
|
||||
"-23x.45"
|
||||
],
|
||||
[
|
||||
"ArrayOfNum",
|
||||
[
|
||||
"value",
|
||||
1
|
||||
],
|
||||
[
|
||||
"value",
|
||||
2
|
||||
],
|
||||
[
|
||||
"value",
|
||||
[
|
||||
"subValue",
|
||||
{
|
||||
"svAttr": "svValue"
|
||||
},
|
||||
"abc"
|
||||
]
|
||||
],
|
||||
[
|
||||
"value",
|
||||
3
|
||||
],
|
||||
[
|
||||
"value",
|
||||
4.1
|
||||
],
|
||||
[
|
||||
"value",
|
||||
5.2
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
27
src/test/resources/XmlTestCaseTestToJsonArray.xml
Normal file
27
src/test/resources/XmlTestCaseTestToJsonArray.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<addresses xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation='test.xsd'>
|
||||
<address addrType="my address">
|
||||
<name nameType="my name">Joe Tester</name>
|
||||
<street><![CDATA[Baker street 5]]></street>
|
||||
<NothingHere except="an attribute"/>
|
||||
<TrueValue>true</TrueValue>
|
||||
<FalseValue>false</FalseValue>
|
||||
<NullValue>null</NullValue>
|
||||
<PositiveValue>42</PositiveValue>
|
||||
<NegativeValue>-23</NegativeValue>
|
||||
<DoubleValue>-23.45</DoubleValue>
|
||||
<Nan>-23x.45</Nan>
|
||||
<ArrayOfNum>
|
||||
<value>1</value>
|
||||
<value>2</value>
|
||||
<value>
|
||||
<subValue svAttr="svValue">abc</subValue>
|
||||
</value>
|
||||
<value>3</value>
|
||||
<value>4.1</value>
|
||||
<value>5.2</value>
|
||||
</ArrayOfNum>
|
||||
</address>
|
||||
</addresses>
|
Reference in New Issue
Block a user