You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_parse.expected 5.9 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. new_obj.to_string()="\u0003"
  2. new_obj.to_string()="foo"
  3. new_obj.to_string()="foo"
  4. new_obj.to_string()="ABC"
  5. new_obj.to_string()=null
  6. new_obj.to_string()=null
  7. new_obj.to_string()=NaN
  8. new_obj.to_string()=null
  9. new_obj.to_string()=null
  10. new_obj.to_string()=null
  11. new_obj.to_string()=Infinity
  12. new_obj.to_string()=Infinity
  13. new_obj.to_string()=-Infinity
  14. new_obj.to_string()=-Infinity
  15. new_obj.to_string()=true
  16. new_obj.to_string()=12
  17. new_obj.to_string()=12.3
  18. new_obj.to_string()=null
  19. new_obj.to_string()=null
  20. new_obj.to_string()={ "FoO": -12.3E512 }
  21. new_obj.to_string()=null
  22. new_obj.to_string()=[ "\n" ]
  23. new_obj.to_string()=[ "\nabc\n" ]
  24. new_obj.to_string()=[ null ]
  25. new_obj.to_string()=[ ]
  26. new_obj.to_string()=[ false ]
  27. new_obj.to_string()=[ "abc", null, "def", 12 ]
  28. new_obj.to_string()={ }
  29. new_obj.to_string()={ "foo": "bar" }
  30. new_obj.to_string()={ "foo": "bar", "baz": null, "bool0": true }
  31. new_obj.to_string()={ "foo": [ null, "foo" ] }
  32. new_obj.to_string()={ "abc": 12, "foo": "bar", "bool0": false, "bool1": true, "arr": [ 1, 2, 3, null, 5 ] }
  33. new_obj.to_string()={ "abc": "blue\nred\ngreen" }
  34. new_obj.to_string()=[ 0.0 ]
  35. new_obj.to_string()=[ 0.0 ]
  36. new_obj.to_string()=null
  37. new_obj.to_string()=[ 9223372036854775807 ]
  38. ==================================
  39. json_tokener_parse_versbose() OK
  40. ==================================
  41. Starting incremental tests.
  42. Note: quotes and backslashes seen in the output here are literal values passed
  43. to the parse functions. e.g. this is 4 characters: "\f"
  44. json_tokener_parse({ "foo) ... got error as expected
  45. json_tokener_parse_ex(tok, { "foo": 123 }, 14) ... OK: got object of type [object]: { "foo": 123 }
  46. json_tokener_parse_ex(tok, { "foo": 456 }, 14) ... OK: got object of type [object]: { "foo": 456 }
  47. json_tokener_parse_ex(tok, { "foo": 789 }, 14) ... OK: got object of type [object]: { "foo": 789 }
  48. json_tokener_parse_ex(tok, { "foo , 6) ... OK: got correct error: continue
  49. json_tokener_parse_ex(tok, ": {"bar , 8) ... OK: got correct error: continue
  50. json_tokener_parse_ex(tok, ":13}} , 6) ... OK: got object of type [object]: { "foo": { "bar": 13 } }
  51. json_tokener_parse_ex(tok, { "foo , 6) ... OK: got correct error: continue
  52. json_tokener_parse_ex(tok, : "bar"} , 8) ... OK: got correct error: unexpected character
  53. json_tokener_parse_ex(tok, { "foo , 6) ... OK: got correct error: continue
  54. json_tokener_parse_ex(tok, ": {"bar , 8) ... OK: got correct error: continue
  55. json_tokener_parse_ex(tok, ":13}}XXXX , 10) ... OK: got object of type [object]: { "foo": { "bar": 13 } }
  56. json_tokener_parse_ex(tok, XXXX , 4) ... OK: got correct error: unexpected character
  57. json_tokener_parse_ex(tok, {"x": 123 }"X", 14) ... OK: got object of type [object]: { "x": 123 }
  58. json_tokener_parse_ex(tok, "Y" , 3) ... OK: got object of type [string]: "Y"
  59. json_tokener_parse_ex(tok, 1 , 1) ... OK: got correct error: continue
  60. json_tokener_parse_ex(tok, 2 , 2) ... OK: got object of type [int]: 12
  61. json_tokener_parse_ex(tok, 12{ , 3) ... OK: got object of type [int]: 12
  62. json_tokener_parse_ex(tok, false , 5) ... OK: got correct error: continue
  63. json_tokener_parse_ex(tok, false , 6) ... OK: got object of type [boolean]: false
  64. json_tokener_parse_ex(tok, true , 4) ... OK: got correct error: continue
  65. json_tokener_parse_ex(tok, true , 5) ... OK: got object of type [boolean]: true
  66. json_tokener_parse_ex(tok, null , 4) ... OK: got correct error: continue
  67. json_tokener_parse_ex(tok, null , 5) ... OK: got object of type [null]: null
  68. json_tokener_parse_ex(tok, noodle , 7) ... OK: got correct error: null expected
  69. json_tokener_parse_ex(tok, naodle , 7) ... OK: got correct error: null expected
  70. json_tokener_parse_ex(tok, track , 6) ... OK: got correct error: boolean expected
  71. json_tokener_parse_ex(tok, null123 , 9) ... OK: got object of type [null]: null
  72. json_tokener_parse_ex(tok, 123 , 4) ... OK: got object of type [int]: 123
  73. json_tokener_parse_ex(tok, nullx , 5) ... OK: got object of type [null]: null
  74. json_tokener_parse_ex(tok, x , 2) ... OK: got correct error: unexpected character
  75. json_tokener_parse_ex(tok, {"a":1}{"b":2}, 15) ... OK: got object of type [object]: { "a": 1 }
  76. json_tokener_parse_ex(tok, {"b":2} , 8) ... OK: got object of type [object]: { "b": 2 }
  77. json_tokener_parse_ex(tok, 2015-01-15 , 10) ... OK: got correct error: number expected
  78. json_tokener_parse_ex(tok, "blue" , 6) ... OK: got object of type [string]: "blue"
  79. json_tokener_parse_ex(tok, "\"" , 4) ... OK: got object of type [string]: "\""
  80. json_tokener_parse_ex(tok, "\\" , 4) ... OK: got object of type [string]: "\\"
  81. json_tokener_parse_ex(tok, "\b" , 4) ... OK: got object of type [string]: "\b"
  82. json_tokener_parse_ex(tok, "\f" , 4) ... OK: got object of type [string]: "\f"
  83. json_tokener_parse_ex(tok, "\n" , 4) ... OK: got object of type [string]: "\n"
  84. json_tokener_parse_ex(tok, "\r" , 4) ... OK: got object of type [string]: "\r"
  85. json_tokener_parse_ex(tok, "\t" , 4) ... OK: got object of type [string]: "\t"
  86. json_tokener_parse_ex(tok, "\/" , 4) ... OK: got object of type [string]: "\/"
  87. json_tokener_parse_ex(tok, "/" , 3) ... OK: got object of type [string]: "\/"
  88. json_tokener_parse_ex(tok, [1,2,3] , 7) ... OK: got object of type [array]: [ 1, 2, 3 ]
  89. json_tokener_parse_ex(tok, [1,2,3,] , 8) ... OK: got object of type [array]: [ 1, 2, 3 ]
  90. json_tokener_parse_ex(tok, [1,2,,3,] , 9) ... OK: got correct error: unexpected character
  91. json_tokener_parse_ex(tok, [1,2,3,] , 8) ... OK: got correct error: unexpected character
  92. json_tokener_parse_ex(tok, {"a":1,} , 8) ... OK: got correct error: unexpected character
  93. End Incremental Tests OK=48 ERROR=0
  94. ==================================