new api: strings and keys returned as binaries, integers as integers, floats as floats, tuple format changed from {event, ..., ...} to {jsx, ..., ...}, tests updated

This commit is contained in:
alisdair sullivan 2011-07-26 00:35:17 -07:00
parent 66f5e0b48a
commit 68d78c8e25
26 changed files with 379 additions and 420 deletions

View file

@ -1,8 +1,8 @@
{name, "array"}.
{jsx, [start_array,
{string,"foo"},
{string,"bar"},
{string,"baz"},
{string,<<"foo">>},
{string,<<"bar">>},
{string,<<"baz">>},
start_array,
{literal,true},
end_array,start_array,
@ -15,14 +15,14 @@
{literal,null},
{float,0.7},
start_object,
{key,"key"},
{string,"value"},
{key,<<"key">>},
{string,<<"value">>},
end_object,start_array,start_object,end_object,
{literal,null},
{literal,null},
{literal,null},
start_array,end_array,end_array,
{string,"\n\r\\"},
{string,<<"\n\r\\">>},
start_array,
{integer,-1},
end_array,end_array,end_json]}.

View file

@ -1,4 +1,3 @@
{name, "encoded_surrogates"}.
{jsx, [start_array,{string,[66560]},end_array,end_json]}.
{jsx, [start_array,{string,<<66560/utf8>>},end_array,end_json]}.
{json, "encoded_surrogates.json"}.
{jsx_flags, [{escaped_unicode,codepoint}]}.

View file

@ -4,9 +4,9 @@
end_array,
{float,2.0e7},
start_object,
{key,"key"},
{key,<<"key">>},
{float,2.0e7},
{key,"another key"},
{key,<<"another key">>},
{float,2.0e7},
end_object,
{float,4.2e70},

View file

@ -4,14 +4,14 @@
end_array,
{float,2.0},
start_object,
{key,"key"},
{key,<<"key">>},
{float,2.0e7},
{key,"another key"},
{key,<<"another key">>},
{float,2.0e7},
end_object,start_object,
{key,"key"},
{key,<<"key">>},
{float,2.0},
{key,"another key"},
{key,<<"another key">>},
{float,2.0},
end_object,
{float,4.2},

View file

@ -4,9 +4,9 @@
end_array,
{integer,20},
start_object,
{key,"key"},
{key,<<"key">>},
{integer,20},
{key,"another key"},
{key,<<"another key">>},
{integer,20},
end_object,
{integer,42},

View file

@ -1,3 +1,3 @@
{name, "multibyte_utf"}.
{jsx, [start_array,{string,[32,119070,32]},end_array,end_json]}.
{jsx, [start_array,{string,<<32,119070/utf8,32>>},end_array,end_json]}.
{json, "multibyte_utf.json"}.

View file

@ -1,3 +1,3 @@
{name, "naked_string"}.
{jsx, [{string,"this is a naked string"},end_json]}.
{jsx, [{string,<<"this is a naked string">>},end_json]}.
{json, "naked_string.json"}.

View file

@ -4,9 +4,9 @@
end_array,
{integer,0},
start_object,
{key,"key"},
{key,<<"key">>},
{integer,0},
{key,"another key"},
{key,<<"another key">>},
{integer,0},
end_object,
{integer,0},

View file

@ -1,22 +1,22 @@
{name, "object"}.
{jsx, [start_object,
{key,"foo"},
{string,"bar"},
{key,"baz"},
{key,<<"foo">>},
{string,<<"bar">>},
{key,<<"baz">>},
{literal,true},
{key,"false"},
{key,<<"false">>},
{literal,null},
{key,"object"},
{key,<<"object">>},
start_object,
{key,"key"},
{string,"value"},
{key,<<"key">>},
{string,<<"value">>},
end_object,
{key,"list"},
{key,<<"list">>},
start_array,
{literal,null},
{literal,null},
{literal,null},
start_array,end_array,
{string,"\n\r\\"},
{string,<<"\n\r\\">>},
end_array,end_object,end_json]}.
{json, "object.json"}.

View file

@ -1,5 +1,5 @@
{name, "string"}.
{jsx, [start_array,
{string,"this is a random string with \n embedded escapes in it"},
{string,<<"this is a random string with \n embedded escapes in it">>},
end_array,end_json]}.
{json, "string.json"}.

View file

@ -1,12 +1,12 @@
{name, "string_escapes"}.
{jsx, [start_array,
{string,"\""},
{string,"\\"},
{string,"/"},
{string,"\b"},
{string,"\f"},
{string,"\n"},
{string,"\r"},
{string,"\t"},
{string,<<"\"">>},
{string,<<"\\">>},
{string,<<"/">>},
{string,<<"\b">>},
{string,<<"\f">>},
{string,<<"\n">>},
{string,<<"\r">>},
{string,<<"\t">>},
end_array,end_json]}.
{json, "string_escapes.json"}.

View file

@ -1 +0,0 @@
[ "non-character: ", "\uffff" ]

View file

@ -1,7 +0,0 @@
{name, "unicode_replaced"}.
{jsx, [start_array,
{string,"non-character: "},
{string,[16#fffd]},
end_array,end_json]}.
{json, "unicode_replaced.json"}.
{jsx_flags, [{escaped_unicode,replace}]}.

View file

@ -1,7 +1,6 @@
{name, "unicode_to_codepoint"}.
{jsx, [start_array,
{string,"arabic letter alef: "},
{string,[1575]},
{string,<<"arabic letter alef: ">>},
{string,<<1575/utf8>>},
end_array,end_json]}.
{json, "unicode_to_codepoint.json"}.
{jsx_flags, [{escaped_unicode,codepoint}]}.

View file

@ -1 +0,0 @@
[ "non-character: ", "\uffff" ]

View file

@ -1,7 +0,0 @@
{name, "unicode_to_codepoint_noncharacter"}.
{jsx, [start_array,
{string,"non-character: "},
{string,"\\uffff"},
end_array,end_json]}.
{json, "unicode_to_codepoint_noncharacter.json"}.
{jsx_flags, [{escaped_unicode,codepoint}]}.

View file

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

View file

@ -1,7 +0,0 @@
{name, "unicode_unconverted"}.
{jsx, [start_array,
{string,"arabic letter alef: "},
{string,"\\u0627"},
end_array,end_json]}.
{json, "unicode_unconverted.json"}.
{jsx_flags, [{escaped_unicode,ascii}]}.

View file

@ -4,9 +4,9 @@
end_array,
{integer,0},
start_object,
{key,"key"},
{key,<<"key">>},
{integer,0},
{key,"another key"},
{key,<<"another key">>},
{integer,0},
end_object,
{integer,0},