No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

36 líneas
893 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(15),
  8. util:test_good(good()),
  9. util:test_errors(errors()),
  10. etap:end_tests().
  11. good() ->
  12. [
  13. {<<"{}">>, {[]}},
  14. {<<"{\"foo\": \"bar\"}">>,
  15. {[{<<"foo">>, <<"bar">>}]},
  16. <<"{\"foo\":\"bar\"}">>},
  17. {<<"\n\n{\"foo\":\r \"bar\",\n \"baz\"\t: 123 }">>,
  18. {[{<<"foo">>, <<"bar">>}, {<<"baz">>, 123}]},
  19. <<"{\"foo\":\"bar\",\"baz\":123}">>}
  20. ].
  21. errors() ->
  22. [
  23. <<"{">>,
  24. <<"{,}">>,
  25. <<"{123:true}">>,
  26. <<"{false:123}">>,
  27. <<"{:\"stuff\"}">>,
  28. <<"{\"key\":}">>,
  29. <<"{\"key\": 123">>,
  30. <<"{\"key\": 123 true">>,
  31. <<"{\"key\": 123,}">>
  32. ].