mirror of
https://github.com/nlohmann/json.git
synced 2024-11-23 22:19:02 +08:00
make pretty
This commit is contained in:
parent
9f562caa2c
commit
822172c502
21
.gitignore
vendored
21
.gitignore
vendored
@ -1,7 +1,20 @@
|
||||
|
||||
.DS_Store
|
||||
src/.DS_Store
|
||||
|
||||
.DS_Store
|
||||
aclocal.m4
|
||||
|
||||
benchmark/auctions.json
|
||||
benchmark/citylots.json
|
||||
autom4te.cache/*
|
||||
|
||||
config.log
|
||||
|
||||
config.status
|
||||
|
||||
configure
|
||||
|
||||
depcomp
|
||||
|
||||
html
|
||||
|
||||
*.o
|
||||
|
||||
*.Po
|
||||
|
@ -218,7 +218,7 @@ void test_array()
|
||||
try
|
||||
{
|
||||
a[5] = 1;
|
||||
// assert(false);
|
||||
// assert(false);
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
|
@ -131,7 +131,7 @@ TEST_CASE("array")
|
||||
j += j;
|
||||
|
||||
CHECK (j.size() == 21);
|
||||
|
||||
|
||||
// implicit transformation into an array
|
||||
JSON empty1, empty2;
|
||||
empty1 += "foo";
|
||||
@ -389,14 +389,14 @@ TEST_CASE("object")
|
||||
// add initializer list (of pairs)
|
||||
{
|
||||
JSON je;
|
||||
je.push_back({ {"one", 1}, {"two", false}, {"three", {1,2,3}} });
|
||||
je.push_back({ {"one", 1}, {"two", false}, {"three", {1, 2, 3}} });
|
||||
CHECK(je["one"].get<int>() == 1);
|
||||
CHECK(je["two"].get<bool>() == false);
|
||||
CHECK(je["three"].size() == 3);
|
||||
}
|
||||
{
|
||||
JSON je;
|
||||
je += { {"one", 1}, {"two", false}, {"three", {1,2,3}} };
|
||||
je += { {"one", 1}, {"two", false}, {"three", {1, 2, 3}} };
|
||||
CHECK(je["one"].get<int>() == 1);
|
||||
CHECK(je["two"].get<bool>() == false);
|
||||
CHECK(je["three"].size() == 3);
|
||||
|
Loading…
Reference in New Issue
Block a user