選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

36 行
918 B

  1. #! /usr/bin/env escript
  2. main([]) ->
  3. code:add_pathz("ebin"),
  4. code:add_pathz("test"),
  5. etap:plan(21),
  6. util:test_good(good()),
  7. util:test_errors(errors()),
  8. etap:end_tests().
  9. good() ->
  10. [
  11. {<<"\"\"">>, <<"">>},
  12. {<<"\"0\"">>, <<"0">>},
  13. {<<"\"foo\"">>, <<"foo">>},
  14. {<<"\"\\\"foobar\\\"\"">>, <<"\"foobar\"">>},
  15. {<<"\"\\n\\n\\n\"">>, <<"\n\n\n">>},
  16. {<<"\"\\\" \\b\\f\\r\\n\\t\\\"\"">>, <<"\" \b\f\r\n\t\"">>},
  17. {<<"\"foo\\u0005bar\"">>, <<"foo", 5, "bar">>},
  18. {
  19. <<"\"\\uD834\\uDD1E\"">>,
  20. <<240, 157, 132, 158>>,
  21. <<34, 240, 157, 132, 158, 34>>
  22. }
  23. ].
  24. errors() ->
  25. [
  26. <<"\"", 0, "\"">>,
  27. <<"\"\\g\"">>,
  28. <<"\"\\uFFFF\"">>,
  29. <<"\"\\uD834foo\\uDD1E\"">>,
  30. % CouchDB-345
  31. <<"\"",78,69,73,77,69,78,32,70,216,82,82,32,70,65,69,78,33,"\"">>
  32. ].