From a201bc981de224bfd0cd5a8a9af6b49bf3a653a4 Mon Sep 17 00:00:00 2001 From: Niels Date: Tue, 10 Feb 2015 23:45:18 +0100 Subject: [PATCH] more test cases --- test/unit.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/unit.cpp b/test/unit.cpp index eae9b758..27d1cca4 100644 --- a/test/unit.cpp +++ b/test/unit.cpp @@ -4052,6 +4052,15 @@ TEST_CASE("parser class") break; } + case (' '): + case ('\t'): + case ('\n'): + case ('\r'): + { + CHECK(json::parser(s).last_token == json::parser::token_type::end_of_input); + break; + } + default: { CHECK(json::parser(s).last_token == json::parser::token_type::parse_error); @@ -4095,5 +4104,6 @@ TEST_CASE("parser class") CHECK(json::parser::token_type_name(json::parser::token_type::name_separator) == ":"); CHECK(json::parser::token_type_name(json::parser::token_type::value_separator) == ","); CHECK(json::parser::token_type_name(json::parser::token_type::parse_error) == ""); + CHECK(json::parser::token_type_name(json::parser::token_type::end_of_input) == ""); } }