Fixed bug in parser when "null", "true" or "false" is mispelled

This commit is contained in:
Benoit Blanchon
2014-10-31 21:08:04 +01:00
parent 98463ea168
commit fead9b50b1
3 changed files with 33 additions and 10 deletions

View File

@ -143,6 +143,21 @@ TEST_F(JsonParser_Array_Tests, TwoNulls) {
secondElementMustBe(nullCharPtr);
}
TEST_F(JsonParser_Array_Tests, IncompleteNull) {
whenInputIs("[nul!]");
parseMustFail();
}
TEST_F(JsonParser_Array_Tests, IncompleteTrue) {
whenInputIs("[tru!]");
parseMustFail();
}
TEST_F(JsonParser_Array_Tests, IncompleteFalse) {
whenInputIs("[fals!]");
parseMustFail();
}
TEST_F(JsonParser_Array_Tests, TwoStrings) {
whenInputIs("[\"hello\",\"world\"]");