You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

41 lines
1006 B

#! /usr/bin/env escript
% This file is part of Jiffy released under the MIT license.
% See the LICENSE file for more information.
main([]) ->
code:add_pathz("ebin"),
code:add_pathz("test"),
etap:plan(12),
util:test_good(good()),
util:test_errors(errors()),
etap:end_tests().
good() ->
[
{<<"[{}]">>, [{[]}]},
{<<"{\"foo\":[123]}">>, {[{<<"foo">>, [123]}]}},
{<<"{\"foo\":{\"bar\":true}}">>,
{[{<<"foo">>, {[{<<"bar">>, true}]} }]} },
{<<"{\"foo\":[],\"bar\":{\"baz\":true},\"alice\":\"bob\"}">>,
{[
{<<"foo">>, []},
{<<"bar">>, {[{<<"baz">>, true}]}},
{<<"alice">>, <<"bob">>}
]}
},
{<<"[-123,\"foo\",{\"bar\":[]},null]">>,
[
-123,
<<"foo">>,
{[{<<"bar">>, []}]},
null
]
}
].
errors() ->
[
<<"[{}">>,
<<"}]">>
].