1
0
mirror of https://github.com/nlohmann/json synced 2024-11-27 06:10:06 +00:00

💚 fixed test case

This commit is contained in:
Niels Lohmann 2018-02-28 22:40:48 +01:00
parent 5773e164bb
commit 8d104e6fe3
No known key found for this signature in database
GPG Key ID: 7F3CEA63AE251B69

View File

@ -152,6 +152,10 @@ TEST_CASE("README", "[hide]")
j.push_back(1);
j.push_back(true);
// comparison
bool x = (j == "[\"foo\", 1, true]"_json); // true
CHECK(x == true);
// iterate the array
for (json::iterator it = j.begin(); it != j.end(); ++it)
{
@ -176,10 +180,6 @@ TEST_CASE("README", "[hide]")
j.type(); // json::value_t::array
j.clear(); // the array is empty again
// comparison
bool x = (j == "[\"foo\", 1, true]"_json); // true
CHECK(x == true);
// create an object
json o;
o["foo"] = 23;