From 17bc86ad6069964c95f75f991836e6cf36486f93 Mon Sep 17 00:00:00 2001 From: alisdair sullivan Date: Sun, 3 Mar 2013 15:34:45 -0800 Subject: [PATCH] fill out comment tests for better test coverage --- src/jsx_decoder.erl | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/jsx_decoder.erl b/src/jsx_decoder.erl index 84e89f4..9e2d757 100644 --- a/src/jsx_decoder.erl +++ b/src/jsx_decoder.erl @@ -1201,6 +1201,14 @@ comments_test_() -> [start_array, {literal, true}, end_array, end_json], decode(<<"[ /* /* comment */ */ true ]">>, [comments]) )}, + {"/**/ comment with /", ?_assertEqual( + [start_array, {literal, true}, end_array, end_json], + decode(<<"[ /* / */ true ]">>, [comments]) + )}, + {"/**/ comment with *", ?_assertEqual( + [start_array, {literal, true}, end_array, end_json], + decode(<<"[ /* * */ true ]">>, [comments]) + )}, {"// comment with badutf", ?_assertEqual( [start_array, {literal, true}, end_array, end_json], decode(<<"[ // comment ", 16#00c0, " ", ?newline, "true]">>, [comments, replaced_bad_utf8]) @@ -1208,6 +1216,10 @@ comments_test_() -> {"/**/ comment with badutf", ?_assertEqual( [start_array, {literal, true}, end_array, end_json], decode(<<"[ /* comment ", 16#00c0, " */ true]">>, [comments, replaced_bad_utf8]) + )}, + {"/**/ comment with badutf preceeded by /", ?_assertEqual( + [start_array, {literal, true}, end_array, end_json], + decode(<<"[ /* comment /", 16#00c0, " */ true]">>, [comments, replaced_bad_utf8]) )} ].