removed fake test and redundant functions

This commit is contained in:
alisdair sullivan 2010-08-10 17:51:04 -07:00
parent 4c3b5559d4
commit 80d42c4e49

View file

@ -41,9 +41,6 @@ test() -> erlang:error(notest).
-else.
fake_test_() ->
[ {"fake test", ?_assert(true)} ].
jsx_decoder_test_() ->
jsx_decoder_gen(load_tests("./test/cases"), [utf8, utf16, {utf16, little}, utf32, {utf32, little}]).
@ -99,22 +96,6 @@ parse_tests([], _Dir, Acc) ->
Acc.
decoder_tests([Test|Rest], Encoding, Acc) ->
Name = lists:flatten(proplists:get_value(name, Test) ++ "::" ++ io_lib:format("~p", [Encoding])),
JSON = unicode:characters_to_binary(proplists:get_value(json, Test), unicode, Encoding),
JSX = proplists:get_value(jsx, Test),
Flags = proplists:get_value(jsx_flags, Test, []),
decoder_tests(Rest,
Encoding,
[{"incremental " ++ Name, ?_assert(incremental_decode(JSON, Flags) =:= JSX)}]
++ [{Name, ?_assert(decode(JSON, Flags) =:= JSX)}]
++ Acc
);
decoder_tests([], _Encoding, Acc) ->
io:format("~p~n", [Acc]),
Acc.
decode(JSON, Flags) ->
P = jsx:parser(Flags),
decode_loop(P(JSON), []).