1 new_obj.to_string("")="\u0003" 2 new_obj.to_string(/* hello */"foo")="foo" 3 new_obj.to_string(// hello 4 "foo")="foo" 5 new_obj.to_string("foo"blue)="foo" 6 new_obj.to_string('foo')="foo" 7 new_obj.to_string("\u0041\u0042\u0043")="ABC" 8 new_obj.to_string("\u4e16\u754c\u00df")="世界ß" 9 new_obj.to_string("\u4E16")="世" 10 new_obj.to_string("\u4e1")=null 11 new_obj.to_string("\u4e1@")=null 12 new_obj.to_string("\ud840\u4e16")="�世" 13 new_obj.to_string("\ud840")="�" 14 new_obj.to_string("\udd27")="�" 15 new_obj.to_string([9,'\uDAD)=null 16 new_obj.to_string(null)=null 17 new_obj.to_string(NaN)=NaN 18 new_obj.to_string(-NaN)=null 19 new_obj.to_string(Inf)=null 20 new_obj.to_string(inf)=null 21 new_obj.to_string(Infinity)=Infinity 22 new_obj.to_string(infinity)=Infinity 23 new_obj.to_string(-Infinity)=-Infinity 24 new_obj.to_string(-infinity)=-Infinity 25 new_obj.to_string({ "min": Infinity, "max": -Infinity})={ "min": Infinity, "max": -Infinity } 26 new_obj.to_string(Infinity!)=Infinity 27 new_obj.to_string(Infinitynull)=Infinity 28 new_obj.to_string(InfinityXXXX)=Infinity 29 new_obj.to_string(-Infinitynull)=-Infinity 30 new_obj.to_string(-InfinityXXXX)=-Infinity 31 new_obj.to_string(Infinoodle)=null 32 new_obj.to_string(InfinAAA)=null 33 new_obj.to_string(-Infinoodle)=null 34 new_obj.to_string(-InfinAAA)=null 35 new_obj.to_string(True)=true 36 new_obj.to_string(False)=false 37 new_obj.to_string(tRue)=true 38 new_obj.to_string(fAlse)=false 39 new_obj.to_string(nAn)=NaN 40 new_obj.to_string(iNfinity)=Infinity 41 new_obj.to_string(12)=12 42 new_obj.to_string(12.3)=12.3 43 new_obj.to_string(12.3.4)=12.3 44 new_obj.to_string(2015-01-15)=2015 45 new_obj.to_string(12.3xxx)=12.3 46 new_obj.to_string(12.3{"a":123})=12.3 47 new_obj.to_string(12.3 48 )=12.3 49 new_obj.to_string(12.3 )=12.3 50 new_obj.to_string({"FoO" : -12.3E512})={ "FoO": -12.3E512 } 51 new_obj.to_string({"FoO" : -12.3e512})={ "FoO": -12.3e512 } 52 new_obj.to_string({"FoO" : -12.3E51.2})=null 53 new_obj.to_string({"FoO" : -12.3E512E12})=null 54 new_obj.to_string(["\n"])=[ "\n" ] 55 new_obj.to_string(["\nabc\n"])=[ "\nabc\n" ] 56 new_obj.to_string([null])=[ null ] 57 new_obj.to_string([])=[ ] 58 new_obj.to_string([false])=[ false ] 59 new_obj.to_string(["abc",null,"def",12])=[ "abc", null, "def", 12 ] 60 new_obj.to_string({})={ } 61 new_obj.to_string({ "foo": "bar" })={ "foo": "bar" } 62 new_obj.to_string({ 'foo': 'bar' })={ "foo": "bar" } 63 new_obj.to_string({ "foo": "bar", "baz": null, "bool0": true })={ "foo": "bar", "baz": null, "bool0": true } 64 new_obj.to_string({ "foo": [null, "foo"] })={ "foo": [ null, "foo" ] } 65 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 ] } 66 new_obj.to_string({ "abc": "blue 67 red\ngreen" })={ "abc": "blue\nred\ngreen" } 68 new_obj.to_string(null)=null 69 new_obj.to_string(false)=false 70 new_obj.to_string([0e])=[ 0.0 ] 71 new_obj.to_string([0e+])=[ 0.0 ] 72 new_obj.to_string([0e+-1])=null 73 new_obj.to_string("hello world!")="hello world!" 74 new_obj.to_string([9223372036854775806])=[ 9223372036854775806 ] 75 new_obj.to_string([9223372036854775807])=[ 9223372036854775807 ] 76 new_obj.to_string([9223372036854775808])=[ 9223372036854775808 ] 77 new_obj.to_string([-9223372036854775807])=[ -9223372036854775807 ] 78 new_obj.to_string([-9223372036854775808])=[ -9223372036854775808 ] 79 new_obj.to_string([-9223372036854775809])=[ -9223372036854775808 ] 80 new_obj.to_string([18446744073709551614])=[ 18446744073709551614 ] 81 new_obj.to_string([18446744073709551615])=[ 18446744073709551615 ] 82 new_obj.to_string([18446744073709551616])=[ 18446744073709551615 ] 83 ================================== 84 new_obj.to_string()=null 85 new_obj.to_string({})=null 86 ================================== 87 json_tokener_parse_verbose() OK 88 ================================== 89 Starting incremental tests. 90 Note: quotes and backslashes seen in the output here are literal values passed 91 to the parse functions. e.g. this is 4 characters: "\f" 92 json_tokener_parse({ "foo) ... got error as expected 93 json_tokener_parse_ex(tok, { "foo": 123 }, 14) ... OK: got object of type [object]: { "foo": 123 } 94 json_tokener_parse_ex(tok, { "foo": 456 }, 14) ... OK: got object of type [object]: { "foo": 456 } 95 json_tokener_parse_ex(tok, { "foo": 789 }, 14) ... OK: got object of type [object]: { "foo": 789 } 96 json_tokener_parse_ex(tok, /* hello */{ "foo", 18) ... OK: got correct error: continue 97 json_tokener_parse_ex(tok, /* hello */:/* hello */, 23) ... OK: got correct error: continue 98 json_tokener_parse_ex(tok, "bar"/* hello */, 16) ... OK: got correct error: continue 99 json_tokener_parse_ex(tok, }/* hello */, 12) ... OK: got object of type [object]: { "foo": "bar" } 100 json_tokener_parse_ex(tok, / hello , 8) ... OK: got correct error: expected comment 101 json_tokener_parse_ex(tok, /* hello"foo", 13) ... OK: got correct error: continue 102 json_tokener_parse_ex(tok, /* hello*"foo", 14) ... OK: got correct error: continue 103 json_tokener_parse_ex(tok, // hello"foo", 13) ... OK: got correct error: continue 104 json_tokener_parse_ex(tok, { "foo , 6) ... OK: got correct error: continue 105 json_tokener_parse_ex(tok, ": {"bar , 8) ... OK: got correct error: continue 106 json_tokener_parse_ex(tok, ":13}} , 6) ... OK: got object of type [object]: { "foo": { "bar": 13 } } 107 json_tokener_parse_ex(tok, "\ , 2) ... OK: got correct error: continue 108 json_tokener_parse_ex(tok, u , 1) ... OK: got correct error: continue 109 json_tokener_parse_ex(tok, d , 1) ... OK: got correct error: continue 110 json_tokener_parse_ex(tok, 8 , 1) ... OK: got correct error: continue 111 json_tokener_parse_ex(tok, 3 , 1) ... OK: got correct error: continue 112 json_tokener_parse_ex(tok, 4 , 1) ... OK: got correct error: continue 113 json_tokener_parse_ex(tok, \ , 1) ... OK: got correct error: continue 114 json_tokener_parse_ex(tok, u , 1) ... OK: got correct error: continue 115 json_tokener_parse_ex(tok, d , 1) ... OK: got correct error: continue 116 json_tokener_parse_ex(tok, d , 1) ... OK: got correct error: continue 117 json_tokener_parse_ex(tok, 1 , 1) ... OK: got correct error: continue 118 json_tokener_parse_ex(tok, e" , 2) ... OK: got object of type [string]: "𝄞" 119 json_tokener_parse_ex(tok, "\u , 3) ... OK: got correct error: continue 120 json_tokener_parse_ex(tok, d8 , 2) ... OK: got correct error: continue 121 json_tokener_parse_ex(tok, 34 , 2) ... OK: got correct error: continue 122 json_tokener_parse_ex(tok, \u , 2) ... OK: got correct error: continue 123 json_tokener_parse_ex(tok, dd , 2) ... OK: got correct error: continue 124 json_tokener_parse_ex(tok, 1e" , 3) ... OK: got object of type [string]: "𝄞" 125 json_tokener_parse_ex(tok, "\ud834 , 7) ... OK: got correct error: continue 126 json_tokener_parse_ex(tok, \udd1e" , 7) ... OK: got object of type [string]: "𝄞" 127 json_tokener_parse_ex(tok, "\ud834\ , 8) ... OK: got correct error: continue 128 json_tokener_parse_ex(tok, udd1e" , 6) ... OK: got object of type [string]: "𝄞" 129 json_tokener_parse_ex(tok, "\ud834\u , 9) ... OK: got correct error: continue 130 json_tokener_parse_ex(tok, dd1e" , 5) ... OK: got object of type [string]: "𝄞" 131 json_tokener_parse_ex(tok, "fff \ud834\ud, 14) ... OK: got correct error: continue 132 json_tokener_parse_ex(tok, d1e bar" , 8) ... OK: got object of type [string]: "fff 𝄞 bar" 133 json_tokener_parse_ex(tok, "fff \ud834\udd, 15) ... OK: got correct error: continue 134 json_tokener_parse_ex(tok, 1e bar" , 7) ... OK: got object of type [string]: "fff 𝄞 bar" 135 json_tokener_parse_ex(tok, "fff \ud83d\ude, 15) ... OK: got correct error: continue 136 json_tokener_parse_ex(tok, 00 bar" , 7) ... OK: got object of type [string]: "fff 😀 bar" 137 json_tokener_parse_ex(tok, { "foo , 6) ... OK: got correct error: continue 138 json_tokener_parse_ex(tok, : "bar"} , 8) ... OK: got correct error: unexpected character 139 json_tokener_parse_ex(tok, { "foo , 6) ... OK: got correct error: continue 140 json_tokener_parse_ex(tok, ": {"bar , 8) ... OK: got correct error: continue 141 json_tokener_parse_ex(tok, ":13}}XXXX , 10) ... OK: got object of type [object]: { "foo": { "bar": 13 } } 142 json_tokener_parse_ex(tok, XXXX , 4) ... OK: got correct error: unexpected character 143 json_tokener_parse_ex(tok, {"x": 123 }"X", 14) ... OK: got object of type [object]: { "x": 123 } 144 json_tokener_parse_ex(tok, "Y" , 3) ... OK: got object of type [string]: "Y" 145 json_tokener_parse_ex(tok, {"foo":9}{"bar":8}, 18) ... OK: got correct error: unexpected character 146 json_tokener_parse_ex(tok, {"foo":9}{"bar":8}, 18) ... OK: got object of type [object]: { "foo": 9 } 147 json_tokener_parse_ex(tok, {"b":8}ignored garbage, 22) ... OK: got object of type [object]: { "b": 8 } 148 json_tokener_parse_ex(tok, 1 , 1) ... OK: got correct error: continue 149 json_tokener_parse_ex(tok, 2 , 2) ... OK: got object of type [int]: 12 150 json_tokener_parse_ex(tok, 12{ , 3) ... OK: got object of type [int]: 12 151 json_tokener_parse_ex(tok, [02] , 4) ... OK: got correct error: number expected 152 json_tokener_parse_ex(tok, 0e+0 , 5) ... OK: got object of type [double]: 0e+0 153 json_tokener_parse_ex(tok, [0e+0] , 6) ... OK: got object of type [array]: [ 0e+0 ] 154 json_tokener_parse_ex(tok, 0e , 2) ... OK: got correct error: continue 155 json_tokener_parse_ex(tok, 0e , 3) ... OK: got object of type [double]: 0 156 json_tokener_parse_ex(tok, 0e , 3) ... OK: got correct error: unexpected end of data 157 json_tokener_parse_ex(tok, [0e] , 4) ... OK: got object of type [array]: [ 0 ] 158 json_tokener_parse_ex(tok, [0e] , 4) ... OK: got correct error: number expected 159 json_tokener_parse_ex(tok, 0e+ , 3) ... OK: got correct error: continue 160 json_tokener_parse_ex(tok, 0e+ , 4) ... OK: got object of type [double]: 0 161 json_tokener_parse_ex(tok, 0e+ , 4) ... OK: got correct error: unexpected end of data 162 json_tokener_parse_ex(tok, [0e+] , 5) ... OK: got object of type [array]: [ 0 ] 163 json_tokener_parse_ex(tok, [0e+] , 5) ... OK: got correct error: number expected 164 json_tokener_parse_ex(tok, 0e- , 3) ... OK: got correct error: continue 165 json_tokener_parse_ex(tok, 0e- , 4) ... OK: got object of type [double]: 0 166 json_tokener_parse_ex(tok, 0e- , 4) ... OK: got correct error: unexpected end of data 167 json_tokener_parse_ex(tok, [0e-] , 5) ... OK: got object of type [array]: [ 0 ] 168 json_tokener_parse_ex(tok, [0e-] , 5) ... OK: got correct error: number expected 169 json_tokener_parse_ex(tok, 0e+- , 5) ... OK: got object of type [double]: 0 170 json_tokener_parse_ex(tok, 0e+- , 5) ... OK: got correct error: number expected 171 json_tokener_parse_ex(tok, [0e+-] , 6) ... OK: got correct error: number expected 172 json_tokener_parse_ex(tok, false , 5) ... OK: got correct error: continue 173 json_tokener_parse_ex(tok, false , 6) ... OK: got object of type [boolean]: false 174 json_tokener_parse_ex(tok, true , 4) ... OK: got correct error: continue 175 json_tokener_parse_ex(tok, true , 5) ... OK: got object of type [boolean]: true 176 json_tokener_parse_ex(tok, null , 4) ... OK: got correct error: continue 177 json_tokener_parse_ex(tok, null , 5) ... OK: got object of type [null]: null 178 json_tokener_parse_ex(tok, Infinity , 9) ... OK: got object of type [double]: Infinity 179 json_tokener_parse_ex(tok, infinity , 9) ... OK: got object of type [double]: Infinity 180 json_tokener_parse_ex(tok, -infinity , 10) ... OK: got object of type [double]: -Infinity 181 json_tokener_parse_ex(tok, infinity , 9) ... OK: got correct error: unexpected character 182 json_tokener_parse_ex(tok, -infinity , 10) ... OK: got correct error: unexpected character 183 json_tokener_parse_ex(tok, inf , 3) ... OK: got correct error: continue 184 json_tokener_parse_ex(tok, inity , 6) ... OK: got object of type [double]: Infinity 185 json_tokener_parse_ex(tok, -inf , 4) ... OK: got correct error: continue 186 json_tokener_parse_ex(tok, inity , 6) ... OK: got object of type [double]: -Infinity 187 json_tokener_parse_ex(tok, i , 1) ... OK: got correct error: continue 188 json_tokener_parse_ex(tok, n , 1) ... OK: got correct error: continue 189 json_tokener_parse_ex(tok, f , 1) ... OK: got correct error: continue 190 json_tokener_parse_ex(tok, i , 1) ... OK: got correct error: continue 191 json_tokener_parse_ex(tok, n , 1) ... OK: got correct error: continue 192 json_tokener_parse_ex(tok, i , 1) ... OK: got correct error: continue 193 json_tokener_parse_ex(tok, t , 1) ... OK: got correct error: continue 194 json_tokener_parse_ex(tok, y , 1) ... OK: got correct error: continue 195 json_tokener_parse_ex(tok, , 1) ... OK: got object of type [double]: Infinity 196 json_tokener_parse_ex(tok, - , 1) ... OK: got correct error: continue 197 json_tokener_parse_ex(tok, inf , 3) ... OK: got correct error: continue 198 json_tokener_parse_ex(tok, ini , 3) ... OK: got correct error: continue 199 json_tokener_parse_ex(tok, ty , 3) ... OK: got object of type [double]: -Infinity 200 json_tokener_parse_ex(tok, - , 1) ... OK: got correct error: continue 201 json_tokener_parse_ex(tok, i , 1) ... OK: got correct error: continue 202 json_tokener_parse_ex(tok, nfini , 5) ... OK: got correct error: continue 203 json_tokener_parse_ex(tok, ty , 3) ... OK: got object of type [double]: -Infinity 204 json_tokener_parse_ex(tok, -i , 2) ... OK: got correct error: continue 205 json_tokener_parse_ex(tok, nfinity , 8) ... OK: got object of type [double]: -Infinity 206 json_tokener_parse_ex(tok, InfinityX , 10) ... OK: got object of type [double]: Infinity 207 json_tokener_parse_ex(tok, X , 1) ... OK: got correct error: unexpected character 208 json_tokener_parse_ex(tok, Infinity1234, 13) ... OK: got object of type [double]: Infinity 209 json_tokener_parse_ex(tok, 1234 , 5) ... OK: got object of type [int]: 1234 210 json_tokener_parse_ex(tok, Infinity9999, 8) ... OK: got correct error: continue 211 json_tokener_parse_ex(tok, 1234 , 5) ... OK: got object of type [double]: Infinity 212 json_tokener_parse_ex(tok, 1234 , 5) ... OK: got object of type [int]: 1234 213 json_tokener_parse_ex(tok, noodle , 7) ... OK: got correct error: null expected 214 json_tokener_parse_ex(tok, naodle , 7) ... OK: got correct error: null expected 215 json_tokener_parse_ex(tok, track , 6) ... OK: got correct error: boolean expected 216 json_tokener_parse_ex(tok, fail , 5) ... OK: got correct error: boolean expected 217 json_tokener_parse_ex(tok, null123 , 8) ... OK: got object of type [null]: null 218 json_tokener_parse_ex(tok, 123 , 4) ... OK: got object of type [int]: 123 219 json_tokener_parse_ex(tok, nullx , 6) ... OK: got object of type [null]: null 220 json_tokener_parse_ex(tok, x , 2) ... OK: got correct error: unexpected character 221 json_tokener_parse_ex(tok, {"a":1}{"b":2}, 15) ... OK: got object of type [object]: { "a": 1 } 222 json_tokener_parse_ex(tok, {"b":2} , 8) ... OK: got object of type [object]: { "b": 2 } 223 json_tokener_parse_ex(tok, 2015-01-15 , 11) ... OK: got object of type [int]: 2015 224 json_tokener_parse_ex(tok, -01-15 , 7) ... OK: got object of type [int]: -1 225 json_tokener_parse_ex(tok, -15 , 4) ... OK: got object of type [int]: -15 226 json_tokener_parse_ex(tok, 2015 01 15 , 11) ... OK: got object of type [int]: 2015 227 json_tokener_parse_ex(tok, 01 15 , 7) ... OK: got object of type [int]: 1 228 json_tokener_parse_ex(tok, 15 , 4) ... OK: got object of type [int]: 15 229 json_tokener_parse_ex(tok, "blue" , 6) ... OK: got object of type [string]: "blue" 230 json_tokener_parse_ex(tok, "\"" , 4) ... OK: got object of type [string]: "\"" 231 json_tokener_parse_ex(tok, "\\" , 4) ... OK: got object of type [string]: "\\" 232 json_tokener_parse_ex(tok, "\b" , 4) ... OK: got object of type [string]: "\b" 233 json_tokener_parse_ex(tok, "\f" , 4) ... OK: got object of type [string]: "\f" 234 json_tokener_parse_ex(tok, "\n" , 4) ... OK: got object of type [string]: "\n" 235 json_tokener_parse_ex(tok, "\r" , 4) ... OK: got object of type [string]: "\r" 236 json_tokener_parse_ex(tok, "\t" , 4) ... OK: got object of type [string]: "\t" 237 json_tokener_parse_ex(tok, "\/" , 4) ... OK: got object of type [string]: "\/" 238 json_tokener_parse_ex(tok, "/" , 3) ... OK: got object of type [string]: "\/" 239 json_tokener_parse_ex(tok, "\a" , 4) ... OK: got correct error: invalid string sequence 240 json_tokener_parse_ex(tok, 'foo' , 5) ... OK: got correct error: unexpected character 241 json_tokener_parse_ex(tok, [1,2,3] , 7) ... OK: got object of type [array]: [ 1, 2, 3 ] 242 json_tokener_parse_ex(tok, [1,2,3} , 7) ... OK: got correct error: array value separator ',' expected 243 json_tokener_parse_ex(tok, {"a"} , 5) ... OK: got correct error: object property name separator ':' expected 244 json_tokener_parse_ex(tok, {"a":1] , 7) ... OK: got correct error: object value separator ',' expected 245 json_tokener_parse_ex(tok, {"a"::1} , 8) ... OK: got correct error: unexpected character 246 json_tokener_parse_ex(tok, {"a":} , 6) ... OK: got correct error: unexpected character 247 json_tokener_parse_ex(tok, {"a":1,"a":2}, 13) ... OK: got object of type [object]: { "a": 2 } 248 json_tokener_parse_ex(tok, "a":1} , 6) ... OK: got object of type [string]: "a" 249 json_tokener_parse_ex(tok, {"a":1 , 6) ... OK: got correct error: continue 250 json_tokener_parse_ex(tok, [,] , 3) ... OK: got correct error: unexpected character 251 json_tokener_parse_ex(tok, [,1] , 4) ... OK: got correct error: unexpected character 252 json_tokener_parse_ex(tok, [1,2,3,] , 8) ... OK: got object of type [array]: [ 1, 2, 3 ] 253 json_tokener_parse_ex(tok, [1,2,,3,] , 9) ... OK: got correct error: unexpected character 254 json_tokener_parse_ex(tok, [1,2,3,] , 8) ... OK: got correct error: unexpected character 255 json_tokener_parse_ex(tok, {"a":1,} , 8) ... OK: got correct error: unexpected character 256 json_tokener_parse_ex(tok, "123asc$%&" , 11) ... OK: got object of type [string]: "123asc$%&" 257 json_tokener_parse_ex(tok, "123asc$%&" , 11) ... OK: got object of type [string]: "123asc$%&" 258 json_tokener_parse_ex(tok, "世界" , 8) ... OK: got object of type [string]: "世界" 259 json_tokener_parse_ex(tok, " , 3) ... OK: got correct error: invalid utf-8 string 260 json_tokener_parse_ex(tok, 界" , 5) ... OK: got correct error: invalid utf-8 string 261 json_tokener_parse_ex(tok, "世界" , 8) ... OK: got object of type [string]: "世界" 262 json_tokener_parse_ex(tok, "πφ" , 6) ... OK: got object of type [string]: "πφ" 263 json_tokener_parse_ex(tok, "𥑕" , 6) ... OK: got object of type [string]: "𥑕" 264 json_tokener_parse_ex(tok, "N" , 5) ... OK: got correct error: invalid utf-8 string 265 json_tokener_parse_ex(tok, "N" , 5) ... OK: got object of type [string]: "N" 266 json_tokener_parse_ex(tok, "" , 6) ... OK: got correct error: invalid utf-8 string 267 json_tokener_parse_ex(tok, "" , 6) ... OK: got object of type [string]: "" 268 json_tokener_parse_ex(tok, "世" , 7) ... OK: got object of type [string]: "世" 269 json_tokener_parse_ex(tok, "世" , 8) ... OK: got correct error: invalid utf-8 string 270 json_tokener_parse_ex(tok, [ 1] , 5) ... OK: got correct error: invalid utf-8 string 271 json_tokener_parse_ex(tok, Infinity , 9) ... OK: got object of type [double]: Infinity 272 json_tokener_parse_ex(tok, Infnity , 8) ... OK: got correct error: invalid utf-8 string 273 json_tokener_parse_ex(tok, "\ud855\udc55", 15) ... OK: got object of type [string]: "𥑕" 274 json_tokener_parse_ex(tok, "\ud855udc55", 14) ... OK: got correct error: invalid utf-8 string 275 json_tokener_parse_ex(tok, "\ud0031" , 10) ... OK: got correct error: invalid utf-8 string 276 json_tokener_parse_ex(tok, 1111 , 5) ... OK: got correct error: invalid utf-8 string 277 json_tokener_parse_ex(tok, {"1":1} , 8) ... OK: got correct error: invalid utf-8 string 278 End Incremental Tests OK=185 ERROR=0 279 ==================================
This page was automatically generated by LXR 0.3.1. • OpenWrt