Browse files

add naked single quoted json escape test

  • Loading branch information...
1 parent 95feb74 commit 357e3e0aebe65a0555c67f908a1ce8aebb778648 @talentdeficit committed Mar 31, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/jsx_decoder.erl
View
1 src/jsx_decoder.erl
@@ -1475,6 +1475,7 @@ escapes_test_() ->
{"tab escape", ?_assertEqual(decode(<<"\"\\t\"">>, [json_escape]), [{string, <<"\\t">>}, end_json])},
{"quote escape", ?_assertEqual(decode(<<"\"\\\"\"">>, [json_escape]), [{string, <<"\\\"">>}, end_json])},
{"single quote escape", ?_assertEqual(decode(<<"\"'\"">>, [json_escape, single_quotes]), [{string, <<"\\'">>}, end_json])},
+ {"naked single quote escape", ?_assertEqual(decode(<<"'\\''">>, [json_escape, single_quotes]), [{string, <<"\\'">>}, end_json])},
{"no single quote escape", ?_assertEqual(decode(<<"\"'\"">>, [json_escape]), [{string, <<"'">>}, end_json])},
{"forward slash escape", ?_assertEqual(decode(<<"\"/\"">>, [json_escape, escape_forward_slash]), [{string, <<"\\/">>}, end_json])},
{"no forward slash escape", ?_assertEqual(decode(<<"\"/\"">>, [json_escape]), [{string, <<"/">>}, end_json])},

0 comments on commit 357e3e0

Please sign in to comment.