rewrote test harness to use eunit and make it easier to add future tests
This commit is contained in:
parent
f5f1f588d4
commit
ab67abd01a
37 changed files with 121 additions and 81 deletions
1
test/cases/absurdly_deep_array.json
Normal file
1
test/cases/absurdly_deep_array.json
Normal file
File diff suppressed because one or more lines are too long
1
test/cases/absurdly_deep_array.test
Normal file
1
test/cases/absurdly_deep_array.test
Normal file
File diff suppressed because one or more lines are too long
1
test/cases/array.json
Normal file
1
test/cases/array.json
Normal file
|
@ -0,0 +1 @@
|
|||
["foo","bar", "baz",true,false,null,{"key":"value"},[null,null,null,[]],"\n\r\\"]
|
1
test/cases/array.test
Normal file
1
test/cases/array.test
Normal file
|
@ -0,0 +1 @@
|
|||
[start_array, {string, "foo"}, {string, "bar"}, {string, "baz"}, {literal, true}, {literal, false}, {literal, null}, start_object, {key, "key"}, {string, "value"}, end_object, start_array, {literal, null}, {literal, null}, {literal, null}, start_array, end_array, end_array, {string, "\n\r\\"}, end_array].
|
1
test/cases/comments.json
Normal file
1
test/cases/comments.json
Normal file
|
@ -0,0 +1 @@
|
|||
[/*array open comment*/ "a string"/*string comment*/, 1/*number comment*/, {/*object open comment*/"key"/*post key comment*/:/*colon comment*/[]/*object close comment*/}, true/*literal comment*/]
|
2
test/cases/comments.test
Normal file
2
test/cases/comments.test
Normal file
|
@ -0,0 +1,2 @@
|
|||
[start_array, {string, "a string"}, {number, "1"}, start_object, {key, "key"}, start_array, end_array, end_object, {literal, true}, end_array].
|
||||
[{comments, true}].
|
1
test/cases/deep_array.json
Normal file
1
test/cases/deep_array.json
Normal file
|
@ -0,0 +1 @@
|
|||
[[[]]]
|
1
test/cases/deep_array.test
Normal file
1
test/cases/deep_array.test
Normal file
|
@ -0,0 +1 @@
|
|||
[start_array, start_array, start_array, end_array, end_array, end_array].
|
1
test/cases/empty_array.json
Normal file
1
test/cases/empty_array.json
Normal file
|
@ -0,0 +1 @@
|
|||
[]
|
1
test/cases/empty_array.test
Normal file
1
test/cases/empty_array.test
Normal file
|
@ -0,0 +1 @@
|
|||
[start_array, end_array].
|
1
test/cases/empty_array_with_comment.json
Normal file
1
test/cases/empty_array_with_comment.json
Normal file
|
@ -0,0 +1 @@
|
|||
[ /* this is a comment and should be ignored */ ]
|
3
test/cases/empty_array_with_comment.test
Normal file
3
test/cases/empty_array_with_comment.test
Normal file
|
@ -0,0 +1,3 @@
|
|||
[start_array, end_array].
|
||||
|
||||
[{comments, true}].
|
1
test/cases/empty_object.json
Normal file
1
test/cases/empty_object.json
Normal file
|
@ -0,0 +1 @@
|
|||
{}
|
1
test/cases/empty_object.test
Normal file
1
test/cases/empty_object.test
Normal file
|
@ -0,0 +1 @@
|
|||
[start_object, end_object].
|
1
test/cases/empty_object_with_comment.json
Normal file
1
test/cases/empty_object_with_comment.json
Normal file
|
@ -0,0 +1 @@
|
|||
{/*comment*/}
|
3
test/cases/empty_object_with_comment.test
Normal file
3
test/cases/empty_object_with_comment.test
Normal file
|
@ -0,0 +1,3 @@
|
|||
[start_object, end_object].
|
||||
|
||||
[{comments, true}].
|
1
test/cases/naked_false.json
Normal file
1
test/cases/naked_false.json
Normal file
|
@ -0,0 +1 @@
|
|||
false
|
2
test/cases/naked_false.test
Normal file
2
test/cases/naked_false.test
Normal file
|
@ -0,0 +1,2 @@
|
|||
[{literal, false}].
|
||||
[{naked_values, true}].
|
1
test/cases/naked_null.json
Normal file
1
test/cases/naked_null.json
Normal file
|
@ -0,0 +1 @@
|
|||
null
|
2
test/cases/naked_null.test
Normal file
2
test/cases/naked_null.test
Normal file
|
@ -0,0 +1,2 @@
|
|||
[{literal, null}].
|
||||
[{naked_values, true}].
|
1
test/cases/naked_number.json
Normal file
1
test/cases/naked_number.json
Normal file
|
@ -0,0 +1 @@
|
|||
42
|
2
test/cases/naked_number.test
Normal file
2
test/cases/naked_number.test
Normal file
|
@ -0,0 +1,2 @@
|
|||
[{number, "42"}].
|
||||
[{naked_values, true}].
|
1
test/cases/naked_string.json
Normal file
1
test/cases/naked_string.json
Normal file
|
@ -0,0 +1 @@
|
|||
"this is a naked string"
|
2
test/cases/naked_string.test
Normal file
2
test/cases/naked_string.test
Normal file
|
@ -0,0 +1,2 @@
|
|||
[{string, "this is a naked string"}].
|
||||
[{naked_values, true}].
|
1
test/cases/naked_true.json
Normal file
1
test/cases/naked_true.json
Normal file
|
@ -0,0 +1 @@
|
|||
true
|
2
test/cases/naked_true.test
Normal file
2
test/cases/naked_true.test
Normal file
|
@ -0,0 +1,2 @@
|
|||
[{literal, true}].
|
||||
[{naked_values, true}].
|
1
test/cases/numbers.json
Normal file
1
test/cases/numbers.json
Normal file
|
@ -0,0 +1 @@
|
|||
[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 42, 127, 99999999999999999999999999999, 1e1, 1E1, 1.0e1, 1.325e478534, -1, -1e-1, 3.7e-57834235 ]
|
1
test/cases/numbers.test
Normal file
1
test/cases/numbers.test
Normal file
|
@ -0,0 +1 @@
|
|||
[ start_array, {number, "1"}, {number, "2"}, {number, "3"}, {number, "4"}, {number, "5"}, {number, "6"}, {number, "7"}, {number, "8"}, {number, "9"}, {number, "42"}, {number, "127"}, {number, "99999999999999999999999999999"}, {number, "1e1"}, {number, "1e1"}, {number, "1.0e1"}, {number, "1.325e478534"}, {number, "-1"}, {number, "-1e-1"}, {number, "3.7e-57834235"}, end_array ].
|
1
test/cases/string.json
Normal file
1
test/cases/string.json
Normal file
|
@ -0,0 +1 @@
|
|||
[ "this is a random string with \n embedded\u0020escapes in it" ]
|
1
test/cases/string.test
Normal file
1
test/cases/string.test
Normal file
|
@ -0,0 +1 @@
|
|||
[start_array, {string, "this is a random string with \n embedded escapes in it"}, end_array].
|
1
test/cases/string_escapes.json
Normal file
1
test/cases/string_escapes.json
Normal file
|
@ -0,0 +1 @@
|
|||
["\"", "\\", "\/", "\b", "\f", "\n", "\r", "\t"]
|
3
test/cases/string_escapes.test
Normal file
3
test/cases/string_escapes.test
Normal file
|
@ -0,0 +1,3 @@
|
|||
[start_array, {string, "\""}, {string, "\\"}, {string, "/"}, {string, "\b"}, {string, "\f"}, {string, "\n"}, {string, "\r"}, {string, "\t"}, end_array].
|
||||
|
||||
|
1
test/cases/unicode.json
Normal file
1
test/cases/unicode.json
Normal file
|
@ -0,0 +1 @@
|
|||
[ "arabic letter alef: ", "\u0627" ]
|
2
test/cases/unicode.test
Normal file
2
test/cases/unicode.test
Normal file
|
@ -0,0 +1,2 @@
|
|||
[start_array, {string, "arabic letter alef: "}, {string, [16#0627]}, end_array].
|
||||
[{escaped_unicode, codepoint}].
|
Loading…
Add table
Add a link
Reference in a new issue