mirror of
https://github.com/json-c/json-c.git
synced 2026-03-28 09:29:06 +08:00
Rewrite test_basic_parse() to factor out a single_basic_parse() to avoid lots of duplicate boiler plate code.
Also, emit the input string in the output so it's easier to see what's going on.
This commit is contained in:
@@ -1,40 +1,42 @@
|
||||
new_obj.to_string()="\u0003"
|
||||
new_obj.to_string()="foo"
|
||||
new_obj.to_string()="foo"
|
||||
new_obj.to_string()="ABC"
|
||||
new_obj.to_string()=null
|
||||
new_obj.to_string()=null
|
||||
new_obj.to_string()=NaN
|
||||
new_obj.to_string()=null
|
||||
new_obj.to_string()=null
|
||||
new_obj.to_string()=null
|
||||
new_obj.to_string()=Infinity
|
||||
new_obj.to_string()=Infinity
|
||||
new_obj.to_string()=-Infinity
|
||||
new_obj.to_string()=-Infinity
|
||||
new_obj.to_string()=true
|
||||
new_obj.to_string()=12
|
||||
new_obj.to_string()=12.3
|
||||
new_obj.to_string()=null
|
||||
new_obj.to_string()=null
|
||||
new_obj.to_string()={ "FoO": -12.3E512 }
|
||||
new_obj.to_string()=null
|
||||
new_obj.to_string()=[ "\n" ]
|
||||
new_obj.to_string()=[ "\nabc\n" ]
|
||||
new_obj.to_string()=[ null ]
|
||||
new_obj.to_string()=[ ]
|
||||
new_obj.to_string()=[ false ]
|
||||
new_obj.to_string()=[ "abc", null, "def", 12 ]
|
||||
new_obj.to_string()={ }
|
||||
new_obj.to_string()={ "foo": "bar" }
|
||||
new_obj.to_string()={ "foo": "bar", "baz": null, "bool0": true }
|
||||
new_obj.to_string()={ "foo": [ null, "foo" ] }
|
||||
new_obj.to_string()={ "abc": 12, "foo": "bar", "bool0": false, "bool1": true, "arr": [ 1, 2, 3, null, 5 ] }
|
||||
new_obj.to_string()={ "abc": "blue\nred\ngreen" }
|
||||
new_obj.to_string()=[ 0.0 ]
|
||||
new_obj.to_string()=[ 0.0 ]
|
||||
new_obj.to_string()=null
|
||||
new_obj.to_string()=[ 9223372036854775807 ]
|
||||
new_obj.to_string("")="\u0003"
|
||||
new_obj.to_string(/* hello */"foo")="foo"
|
||||
new_obj.to_string(// hello
|
||||
"foo")="foo"
|
||||
new_obj.to_string("\u0041\u0042\u0043")="ABC"
|
||||
new_obj.to_string([9,'\uDAD)=null
|
||||
new_obj.to_string(null)=null
|
||||
new_obj.to_string(NaN)=NaN
|
||||
new_obj.to_string(-NaN)=null
|
||||
new_obj.to_string(Inf)=null
|
||||
new_obj.to_string(inf)=null
|
||||
new_obj.to_string(Infinity)=Infinity
|
||||
new_obj.to_string(infinity)=Infinity
|
||||
new_obj.to_string(-Infinity)=-Infinity
|
||||
new_obj.to_string(-infinity)=-Infinity
|
||||
new_obj.to_string(True)=true
|
||||
new_obj.to_string(12)=12
|
||||
new_obj.to_string(12.3)=12.3
|
||||
new_obj.to_string(12.3.4)=null
|
||||
new_obj.to_string(2015-01-15)=null
|
||||
new_obj.to_string({"FoO" : -12.3E512})={ "FoO": -12.3E512 }
|
||||
new_obj.to_string({"FoO" : -12.3E51.2})=null
|
||||
new_obj.to_string(["\n"])=[ "\n" ]
|
||||
new_obj.to_string(["\nabc\n"])=[ "\nabc\n" ]
|
||||
new_obj.to_string([null])=[ null ]
|
||||
new_obj.to_string([])=[ ]
|
||||
new_obj.to_string([false])=[ false ]
|
||||
new_obj.to_string(["abc",null,"def",12])=[ "abc", null, "def", 12 ]
|
||||
new_obj.to_string({})={ }
|
||||
new_obj.to_string({ "foo": "bar" })={ "foo": "bar" }
|
||||
new_obj.to_string({ "foo": "bar", "baz": null, "bool0": true })={ "foo": "bar", "baz": null, "bool0": true }
|
||||
new_obj.to_string({ "foo": [null, "foo"] })={ "foo": [ null, "foo" ] }
|
||||
new_obj.to_string({ "abc": 12, "foo": "bar", "bool0": false, "bool1": true, "arr": [ 1, 2, 3, null, 5 ] })={ "abc": 12, "foo": "bar", "bool0": false, "bool1": true, "arr": [ 1, 2, 3, null, 5 ] }
|
||||
new_obj.to_string({ "abc": "blue
|
||||
red\ngreen" })={ "abc": "blue\nred\ngreen" }
|
||||
new_obj.to_string([0e])=[ 0.0 ]
|
||||
new_obj.to_string([0e+])=[ 0.0 ]
|
||||
new_obj.to_string([0e+-1])=null
|
||||
new_obj.to_string([18446744073709551616])=[ 9223372036854775807 ]
|
||||
==================================
|
||||
json_tokener_parse_versbose() OK
|
||||
==================================
|
||||
|
||||
Reference in New Issue
Block a user