From f3f969c8cbb7a6dff0e71d7f7430e613005ffbc9 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 2 Feb 2015 23:01:57 +1100 Subject: [PATCH] json: rewrite test data for rfc7159 compliance --- test/json/bad/0000_empty.json | 0 test/json/bad/1000_capital_false.json | 1 + test/json/bad/1000_capital_null.json | 1 + test/json/bad/1000_capital_true.json | 1 + test/json/bad/1000_leading_zero.json | 1 + test/json/bad/2000_trailing_comma.json | 4 +--- test/json/bad/2000_unfinished_array.json | 1 + ...{0000_object.json => 2000_unfinished_object.json} | 0 test/json/bad/2001_unfinished_array.json | 1 + ...{0001_object.json => 2001_unfinished_object.json} | 0 test/json/bad/3000_missing_array_seperator.json | 1 + test/json/bad/3000_missing_object_key.json | 1 + test/json/bad/3000_missing_object_seperator.json | 1 + test/json/bad/3000_missing_object_value.json | 1 + test/json/good/0000_false.json | 1 + test/json/good/0000_integer.json | 1 + test/json/good/0000_null.json | 1 + .../good/{1000_pair_str.json => 0000_pair_str.json} | 0 test/json/good/0000_real.json | 8 ++++++++ test/json/good/0000_true.json | 1 + test/json/good/1000_empty_array.json | 2 ++ .../good/{0000_empty.json => 1000_empty_object.json} | 0 test/json/good/1001_pair_number.json | 3 --- test/json/good/1002_pair_number.json | 3 --- test/json/good/1003_pair_number.json | 3 --- test/json/good/1004_pair_number.json | 3 --- test/json/good/1005_pair_number.json | 3 --- test/json/good/1006_pair_number.json | 3 --- test/json/good/1007_pair_number.json | 3 --- test/json/good/1008_bool_true.json | 3 --- test/json/good/1009_bool_false.json | 3 --- test/json/good/1010_null.json | 3 --- test/json/good/2000_array.json | 3 --- test/json/good/2000_recursive_array.json | 1 + test/json/good/2000_recursive_object.json | 1 + test/json/good/2001_recursive_array.json | 1 + test/json/good/2001_recursive_object.json | 1 + test/json/good/3000_object.json | 5 ----- test/json/good/3000_string_escape.json | 12 ++++++++++++ 39 files changed, 41 insertions(+), 41 deletions(-) create mode 100644 test/json/bad/0000_empty.json create mode 100644 test/json/bad/1000_capital_false.json create mode 100644 test/json/bad/1000_capital_null.json create mode 100644 test/json/bad/1000_capital_true.json create mode 100644 test/json/bad/1000_leading_zero.json create mode 100644 test/json/bad/2000_unfinished_array.json rename test/json/bad/{0000_object.json => 2000_unfinished_object.json} (100%) create mode 100644 test/json/bad/2001_unfinished_array.json rename test/json/bad/{0001_object.json => 2001_unfinished_object.json} (100%) create mode 100644 test/json/bad/3000_missing_array_seperator.json create mode 100644 test/json/bad/3000_missing_object_key.json create mode 100644 test/json/bad/3000_missing_object_seperator.json create mode 100644 test/json/bad/3000_missing_object_value.json create mode 100644 test/json/good/0000_false.json create mode 100644 test/json/good/0000_integer.json create mode 100644 test/json/good/0000_null.json rename test/json/good/{1000_pair_str.json => 0000_pair_str.json} (100%) create mode 100644 test/json/good/0000_real.json create mode 100644 test/json/good/0000_true.json create mode 100644 test/json/good/1000_empty_array.json rename test/json/good/{0000_empty.json => 1000_empty_object.json} (100%) delete mode 100644 test/json/good/1001_pair_number.json delete mode 100644 test/json/good/1002_pair_number.json delete mode 100644 test/json/good/1003_pair_number.json delete mode 100644 test/json/good/1004_pair_number.json delete mode 100644 test/json/good/1005_pair_number.json delete mode 100644 test/json/good/1006_pair_number.json delete mode 100644 test/json/good/1007_pair_number.json delete mode 100644 test/json/good/1008_bool_true.json delete mode 100644 test/json/good/1009_bool_false.json delete mode 100644 test/json/good/1010_null.json delete mode 100644 test/json/good/2000_array.json create mode 100644 test/json/good/2000_recursive_array.json create mode 100644 test/json/good/2000_recursive_object.json create mode 100644 test/json/good/2001_recursive_array.json create mode 100644 test/json/good/2001_recursive_object.json delete mode 100644 test/json/good/3000_object.json create mode 100644 test/json/good/3000_string_escape.json diff --git a/test/json/bad/0000_empty.json b/test/json/bad/0000_empty.json new file mode 100644 index 00000000..e69de29b diff --git a/test/json/bad/1000_capital_false.json b/test/json/bad/1000_capital_false.json new file mode 100644 index 00000000..671c0a97 --- /dev/null +++ b/test/json/bad/1000_capital_false.json @@ -0,0 +1 @@ +[False] diff --git a/test/json/bad/1000_capital_null.json b/test/json/bad/1000_capital_null.json new file mode 100644 index 00000000..eeaf3182 --- /dev/null +++ b/test/json/bad/1000_capital_null.json @@ -0,0 +1 @@ +[Null] diff --git a/test/json/bad/1000_capital_true.json b/test/json/bad/1000_capital_true.json new file mode 100644 index 00000000..22d4980c --- /dev/null +++ b/test/json/bad/1000_capital_true.json @@ -0,0 +1 @@ +[True] diff --git a/test/json/bad/1000_leading_zero.json b/test/json/bad/1000_leading_zero.json new file mode 100644 index 00000000..8d13d4c8 --- /dev/null +++ b/test/json/bad/1000_leading_zero.json @@ -0,0 +1 @@ +[ 00 ] diff --git a/test/json/bad/2000_trailing_comma.json b/test/json/bad/2000_trailing_comma.json index 23d1eb03..e8b1a170 100644 --- a/test/json/bad/2000_trailing_comma.json +++ b/test/json/bad/2000_trailing_comma.json @@ -1,3 +1 @@ -{ - "foo" : [1, ] -} +[1,] diff --git a/test/json/bad/2000_unfinished_array.json b/test/json/bad/2000_unfinished_array.json new file mode 100644 index 00000000..558ed37d --- /dev/null +++ b/test/json/bad/2000_unfinished_array.json @@ -0,0 +1 @@ +[ diff --git a/test/json/bad/0000_object.json b/test/json/bad/2000_unfinished_object.json similarity index 100% rename from test/json/bad/0000_object.json rename to test/json/bad/2000_unfinished_object.json diff --git a/test/json/bad/2001_unfinished_array.json b/test/json/bad/2001_unfinished_array.json new file mode 100644 index 00000000..079b5796 --- /dev/null +++ b/test/json/bad/2001_unfinished_array.json @@ -0,0 +1 @@ +] diff --git a/test/json/bad/0001_object.json b/test/json/bad/2001_unfinished_object.json similarity index 100% rename from test/json/bad/0001_object.json rename to test/json/bad/2001_unfinished_object.json diff --git a/test/json/bad/3000_missing_array_seperator.json b/test/json/bad/3000_missing_array_seperator.json new file mode 100644 index 00000000..5a3f03a1 --- /dev/null +++ b/test/json/bad/3000_missing_array_seperator.json @@ -0,0 +1 @@ +[1 2] diff --git a/test/json/bad/3000_missing_object_key.json b/test/json/bad/3000_missing_object_key.json new file mode 100644 index 00000000..992f0c28 --- /dev/null +++ b/test/json/bad/3000_missing_object_key.json @@ -0,0 +1 @@ +{:"bar"} diff --git a/test/json/bad/3000_missing_object_seperator.json b/test/json/bad/3000_missing_object_seperator.json new file mode 100644 index 00000000..2ab1ca5d --- /dev/null +++ b/test/json/bad/3000_missing_object_seperator.json @@ -0,0 +1 @@ +{"foo"} diff --git a/test/json/bad/3000_missing_object_value.json b/test/json/bad/3000_missing_object_value.json new file mode 100644 index 00000000..7d6e2426 --- /dev/null +++ b/test/json/bad/3000_missing_object_value.json @@ -0,0 +1 @@ +{"foo":} diff --git a/test/json/good/0000_false.json b/test/json/good/0000_false.json new file mode 100644 index 00000000..c508d536 --- /dev/null +++ b/test/json/good/0000_false.json @@ -0,0 +1 @@ +false diff --git a/test/json/good/0000_integer.json b/test/json/good/0000_integer.json new file mode 100644 index 00000000..ca856b12 --- /dev/null +++ b/test/json/good/0000_integer.json @@ -0,0 +1 @@ +[0,1,-1,98465] diff --git a/test/json/good/0000_null.json b/test/json/good/0000_null.json new file mode 100644 index 00000000..19765bd5 --- /dev/null +++ b/test/json/good/0000_null.json @@ -0,0 +1 @@ +null diff --git a/test/json/good/1000_pair_str.json b/test/json/good/0000_pair_str.json similarity index 100% rename from test/json/good/1000_pair_str.json rename to test/json/good/0000_pair_str.json diff --git a/test/json/good/0000_real.json b/test/json/good/0000_real.json new file mode 100644 index 00000000..382b490c --- /dev/null +++ b/test/json/good/0000_real.json @@ -0,0 +1,8 @@ +[ +1.0e5, +1.0E5, +-1.0e5, +-1.0e-5, +9.123e2, +15.0e5 +] diff --git a/test/json/good/0000_true.json b/test/json/good/0000_true.json new file mode 100644 index 00000000..27ba77dd --- /dev/null +++ b/test/json/good/0000_true.json @@ -0,0 +1 @@ +true diff --git a/test/json/good/1000_empty_array.json b/test/json/good/1000_empty_array.json new file mode 100644 index 00000000..0d4f101c --- /dev/null +++ b/test/json/good/1000_empty_array.json @@ -0,0 +1,2 @@ +[ +] diff --git a/test/json/good/0000_empty.json b/test/json/good/1000_empty_object.json similarity index 100% rename from test/json/good/0000_empty.json rename to test/json/good/1000_empty_object.json diff --git a/test/json/good/1001_pair_number.json b/test/json/good/1001_pair_number.json deleted file mode 100644 index b86c093e..00000000 --- a/test/json/good/1001_pair_number.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "zero" : 0 -} diff --git a/test/json/good/1002_pair_number.json b/test/json/good/1002_pair_number.json deleted file mode 100644 index 74b667f8..00000000 --- a/test/json/good/1002_pair_number.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "neg" : -1 -} diff --git a/test/json/good/1003_pair_number.json b/test/json/good/1003_pair_number.json deleted file mode 100644 index 97b10960..00000000 --- a/test/json/good/1003_pair_number.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "pos_low_exp" : 1e-5 -} diff --git a/test/json/good/1004_pair_number.json b/test/json/good/1004_pair_number.json deleted file mode 100644 index 61cd15cb..00000000 --- a/test/json/good/1004_pair_number.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "pos_high_exp" : 1e5 -} diff --git a/test/json/good/1005_pair_number.json b/test/json/good/1005_pair_number.json deleted file mode 100644 index b5166095..00000000 --- a/test/json/good/1005_pair_number.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "neg_low_exp" : -4e-9 -} diff --git a/test/json/good/1006_pair_number.json b/test/json/good/1006_pair_number.json deleted file mode 100644 index 2924a16b..00000000 --- a/test/json/good/1006_pair_number.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "neg_high_exp" : 12e15 -} diff --git a/test/json/good/1007_pair_number.json b/test/json/good/1007_pair_number.json deleted file mode 100644 index ca4af5f0..00000000 --- a/test/json/good/1007_pair_number.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "frac" : 1.7e-23 -} diff --git a/test/json/good/1008_bool_true.json b/test/json/good/1008_bool_true.json deleted file mode 100644 index 4bc63ace..00000000 --- a/test/json/good/1008_bool_true.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "foo" : true -} diff --git a/test/json/good/1009_bool_false.json b/test/json/good/1009_bool_false.json deleted file mode 100644 index c1409cca..00000000 --- a/test/json/good/1009_bool_false.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "foo" : false -} diff --git a/test/json/good/1010_null.json b/test/json/good/1010_null.json deleted file mode 100644 index fd37e622..00000000 --- a/test/json/good/1010_null.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "foo" : null -} diff --git a/test/json/good/2000_array.json b/test/json/good/2000_array.json deleted file mode 100644 index 1134791e..00000000 --- a/test/json/good/2000_array.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "numbers" : [0, 1, 2, 3] -} diff --git a/test/json/good/2000_recursive_array.json b/test/json/good/2000_recursive_array.json new file mode 100644 index 00000000..4460d1b1 --- /dev/null +++ b/test/json/good/2000_recursive_array.json @@ -0,0 +1 @@ +[[null]] diff --git a/test/json/good/2000_recursive_object.json b/test/json/good/2000_recursive_object.json new file mode 100644 index 00000000..ee5089ce --- /dev/null +++ b/test/json/good/2000_recursive_object.json @@ -0,0 +1 @@ +{"foo":{}} diff --git a/test/json/good/2001_recursive_array.json b/test/json/good/2001_recursive_array.json new file mode 100644 index 00000000..93d51406 --- /dev/null +++ b/test/json/good/2001_recursive_array.json @@ -0,0 +1 @@ +[{}] diff --git a/test/json/good/2001_recursive_object.json b/test/json/good/2001_recursive_object.json new file mode 100644 index 00000000..6dab5c82 --- /dev/null +++ b/test/json/good/2001_recursive_object.json @@ -0,0 +1 @@ +{"foo":[]} diff --git a/test/json/good/3000_object.json b/test/json/good/3000_object.json deleted file mode 100644 index 009fcb0c..00000000 --- a/test/json/good/3000_object.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "obj" : { - "foo": "bar" - } -} diff --git a/test/json/good/3000_string_escape.json b/test/json/good/3000_string_escape.json new file mode 100644 index 00000000..d864ebfc --- /dev/null +++ b/test/json/good/3000_string_escape.json @@ -0,0 +1,12 @@ +[ +"foo\tbar", +"\"", +"\\", +"\/", +"\b", +"\f", +"\n", +"\r", +"\t", +"\u0062" +]