#! /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() ->
|
|
[
|
|
<<"[{}">>,
|
|
<<"}]">>
|
|
].
|