您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

41 行
1006 B

  1. #! /usr/bin/env escript
  2. % This file is part of Jiffy released under the MIT license.
  3. % See the LICENSE file for more information.
  4. main([]) ->
  5. code:add_pathz("ebin"),
  6. code:add_pathz("test"),
  7. etap:plan(12),
  8. util:test_good(good()),
  9. util:test_errors(errors()),
  10. etap:end_tests().
  11. good() ->
  12. [
  13. {<<"[{}]">>, [{[]}]},
  14. {<<"{\"foo\":[123]}">>, {[{<<"foo">>, [123]}]}},
  15. {<<"{\"foo\":{\"bar\":true}}">>,
  16. {[{<<"foo">>, {[{<<"bar">>, true}]} }]} },
  17. {<<"{\"foo\":[],\"bar\":{\"baz\":true},\"alice\":\"bob\"}">>,
  18. {[
  19. {<<"foo">>, []},
  20. {<<"bar">>, {[{<<"baz">>, true}]}},
  21. {<<"alice">>, <<"bob">>}
  22. ]}
  23. },
  24. {<<"[-123,\"foo\",{\"bar\":[]},null]">>,
  25. [
  26. -123,
  27. <<"foo">>,
  28. {[{<<"bar">>, []}]},
  29. null
  30. ]
  31. }
  32. ].
  33. errors() ->
  34. [
  35. <<"[{}">>,
  36. <<"}]">>
  37. ].