Added failing test for parsing a ? at the start of a value

This commit is contained in:
Jesse Beder 2012-11-08 19:00:46 -06:00
parent 4e1bdd08d3
commit 15b60e2a3b

View File

@ -16,6 +16,18 @@ namespace Test
}
return " no exception caught";
}
TEST PlainScalarStartingWithQuestionMark()
{
HANDLE("foo: ?bar");
EXPECT_DOC_START();
EXPECT_MAP_START("?", 0);
EXPECT_SCALAR("?", 0, "foo");
EXPECT_SCALAR("?", 0, "?bar");
EXPECT_MAP_END();
EXPECT_DOC_END();
DONE();
}
}
namespace {
@ -44,6 +56,7 @@ namespace Test
int passed = 0;
int total = 0;
RunParserTest(&Parser::NoEndOfMapFlow, "No end of map flow", passed, total);
RunParserTest(&Parser::PlainScalarStartingWithQuestionMark, "Plain scalar starting with question mark", passed, total);
std::cout << "Parser tests: " << passed << "/" << total << " passed\n";
return passed == total;