rewrote test harness to use eunit and make it easier to add future tests

This commit is contained in:
alisdair sullivan 2010-05-23 22:40:35 -07:00
parent f5f1f588d4
commit ab67abd01a
37 changed files with 121 additions and 81 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
test/cases/array.json Normal file
View file

@ -0,0 +1 @@
["foo","bar", "baz",true,false,null,{"key":"value"},[null,null,null,[]],"\n\r\\"]

1
test/cases/array.test Normal file
View 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
View 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
View 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}].

View file

@ -0,0 +1 @@
[[[]]]

View file

@ -0,0 +1 @@
[start_array, start_array, start_array, end_array, end_array, end_array].

View file

@ -0,0 +1 @@
[]

View file

@ -0,0 +1 @@
[start_array, end_array].

View file

@ -0,0 +1 @@
[ /* this is a comment and should be ignored */ ]

View file

@ -0,0 +1,3 @@
[start_array, end_array].
[{comments, true}].

View file

@ -0,0 +1 @@
{}

View file

@ -0,0 +1 @@
[start_object, end_object].

View file

@ -0,0 +1 @@
{/*comment*/}

View file

@ -0,0 +1,3 @@
[start_object, end_object].
[{comments, true}].

View file

@ -0,0 +1 @@
false

View file

@ -0,0 +1,2 @@
[{literal, false}].
[{naked_values, true}].

View file

@ -0,0 +1 @@
null

View file

@ -0,0 +1,2 @@
[{literal, null}].
[{naked_values, true}].

View file

@ -0,0 +1 @@
42

View file

@ -0,0 +1,2 @@
[{number, "42"}].
[{naked_values, true}].

View file

@ -0,0 +1 @@
"this is a naked string"

View file

@ -0,0 +1,2 @@
[{string, "this is a naked string"}].
[{naked_values, true}].

View file

@ -0,0 +1 @@
true

View file

@ -0,0 +1,2 @@
[{literal, true}].
[{naked_values, true}].

1
test/cases/numbers.json Normal file
View 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
View 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
View file

@ -0,0 +1 @@
[ "this is a random string with \n embedded\u0020escapes in it" ]

1
test/cases/string.test Normal file
View file

@ -0,0 +1 @@
[start_array, {string, "this is a random string with \n embedded escapes in it"}, end_array].

View file

@ -0,0 +1 @@
["\"", "\\", "\/", "\b", "\f", "\n", "\r", "\t"]

View 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
View file

@ -0,0 +1 @@
[ "arabic letter alef: ", "\u0627" ]

2
test/cases/unicode.test Normal file
View file

@ -0,0 +1,2 @@
[start_array, {string, "arabic letter alef: "}, {string, [16#0627]}, end_array].
[{escaped_unicode, codepoint}].