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.

34 lines
792 B

  1. #! /usr/bin/env escript
  2. main([]) ->
  3. code:add_pathz("ebin"),
  4. code:add_pathz("test"),
  5. etap:plan(18),
  6. util:test_good(good()),
  7. util:test_errors(errors()),
  8. etap:end_tests().
  9. good() ->
  10. [
  11. {<<"[]">>, []},
  12. {<<"[\t[\n]\r]">>, [[]], <<"[[]]">>},
  13. {<<"[\t123, \r true\n]">>, [123, true], <<"[123,true]">>},
  14. {<<"[1,\"foo\"]">>, [1, <<"foo">>]},
  15. {<<"[11993444355.0,1]">>, [11993444355.0,1], <<"[11993444355,1]">>},
  16. {
  17. <<"[\"\\u00A1\",\"\\u00FC\"]">>,
  18. [<<194, 161>>, <<195, 188>>],
  19. <<"[\"", 194, 161, "\",\"", 195, 188, "\"]">>
  20. }
  21. ].
  22. errors() ->
  23. [
  24. <<"[">>,
  25. <<"]">>,
  26. <<"[,]">>,
  27. <<"[123">>,
  28. <<"[123,]">>,
  29. <<"[32 true]">>
  30. ].