mirror of
https://github.com/nlohmann/json.git
synced 2025-07-24 02:21:01 +03:00
💚 fixed test case
This commit is contained in:
@ -152,6 +152,10 @@ TEST_CASE("README", "[hide]")
|
|||||||
j.push_back(1);
|
j.push_back(1);
|
||||||
j.push_back(true);
|
j.push_back(true);
|
||||||
|
|
||||||
|
// comparison
|
||||||
|
bool x = (j == "[\"foo\", 1, true]"_json); // true
|
||||||
|
CHECK(x == true);
|
||||||
|
|
||||||
// iterate the array
|
// iterate the array
|
||||||
for (json::iterator it = j.begin(); it != j.end(); ++it)
|
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.type(); // json::value_t::array
|
||||||
j.clear(); // the array is empty again
|
j.clear(); // the array is empty again
|
||||||
|
|
||||||
// comparison
|
|
||||||
bool x = (j == "[\"foo\", 1, true]"_json); // true
|
|
||||||
CHECK(x == true);
|
|
||||||
|
|
||||||
// create an object
|
// create an object
|
||||||
json o;
|
json o;
|
||||||
o["foo"] = 23;
|
o["foo"] = 23;
|
||||||
|
Reference in New Issue
Block a user