aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/unittest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/unittest.cpp b/tests/unittest.cpp
index 0e23ffd..57a4324 100644
--- a/tests/unittest.cpp
+++ b/tests/unittest.cpp
@@ -453,6 +453,14 @@ TEST(json_read)
q = y["ints"][2].i();
ASSERT_EQUAL(3, q);
+ std::string s2 = R"({"bools":[true, false], "doubles":[1.2, -3.4]})";
+ auto z = json::load(s2);
+ ASSERT_EQUAL(2, z["bools"].size());
+ ASSERT_EQUAL(2, z["doubles"].size());
+ ASSERT_EQUAL(true, z["bools"][0].b());
+ ASSERT_EQUAL(false, z["bools"][1].b());
+ ASSERT_EQUAL(1.2, z["doubles"][0].d());
+ ASSERT_EQUAL(-3.4, z["doubles"][1].d());
}
TEST(json_read_real)