re-added old (failing) test cases

This commit is contained in:
Niels 2015-02-11 10:27:41 +01:00
parent c816fd12a0
commit 4b9bd96ab1

View file

@ -4037,16 +4037,10 @@ TEST_CASE("lexer class")
CHECK(json::lexer::token_type_name(json::lexer::token_type::parse_error) == "<parse error>"); CHECK(json::lexer::token_type_name(json::lexer::token_type::parse_error) == "<parse error>");
CHECK(json::lexer::token_type_name(json::lexer::token_type::end_of_input) == "<end of input>"); CHECK(json::lexer::token_type_name(json::lexer::token_type::end_of_input) == "<end of input>");
} }
}
TEST_CASE("parser class")
{
SECTION("get_token")
{
/*
SECTION("parse errors on first character") SECTION("parse errors on first character")
{ {
for (int c = 1; c < 255; ++c) for (int c = 1; c < 128; ++c)
{ {
auto s = std::string(1, c); auto s = std::string(1, c);
@ -4074,30 +4068,33 @@ TEST_CASE("parser class")
case ('9'): case ('9'):
case ('"'): case ('"'):
{ {
CHECK(json::parser(s).last_token != json::lexer::token_type::parse_error); CHECK(json::lexer(s.c_str()).scan() != json::lexer::token_type::parse_error);
break; break;
} }
// whitespace
case (' '): case (' '):
case ('\t'): case ('\t'):
case ('\n'): case ('\n'):
case ('\r'): case ('\r'):
{ {
CHECK(json::parser(s).last_token == json::lexer::token_type::end_of_input); CHECK(json::lexer(s.c_str()).scan() == json::lexer::token_type::end_of_input);
break; break;
} }
// anything else is not expected
default: default:
{ {
CHECK(json::parser(s).last_token == json::lexer::token_type::parse_error); CHECK(json::lexer(s.c_str()).scan() == json::lexer::token_type::parse_error);
break; break;
} }
} }
} }
} }
*/ }
}
TEST_CASE("parser class")
{
SECTION("parse") SECTION("parse")
{ {
SECTION("null") SECTION("null")