1
0
mirror of https://github.com/nlohmann/json synced 2024-11-27 22:30:09 +00:00

more test cases

This commit is contained in:
Niels 2015-02-11 11:47:00 +01:00
parent f1bd206994
commit 3f46fe7a08

View File

@ -4112,6 +4112,29 @@ TEST_CASE("parser class")
CHECK(json::parser("false").parse() == json(false));
}
SECTION("array")
{
SECTION("empty array")
{
CHECK(json::parser("[]").parse() == json(json::value_t::array));
CHECK(json::parser("[ ]").parse() == json(json::value_t::array));
}
SECTION("nonempty array")
{
CHECK(json::parser("[true, false, null]").parse() == json({true, false, nullptr}));
}
}
SECTION("object")
{
SECTION("empty object")
{
CHECK(json::parser("{}").parse() == json(json::value_t::object));
CHECK(json::parser("{ }").parse() == json(json::value_t::object));
}
}
SECTION("number")
{
SECTION("integers")