diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-08-29 20:01:00 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-08-29 20:01:00 +0100 |
commit | 49cec84ea856c40e3a3b1d2b99bac998df9b3718 (patch) | |
tree | 47a233b5801b11cd9db545f5eabbbc3ee903dd29 | |
parent | Fix handling of empty object and object with nothing after a comma (diff) | |
download | libjsonpp-49cec84ea856c40e3a3b1d2b99bac998df9b3718.tar.bz2 libjsonpp-49cec84ea856c40e3a3b1d2b99bac998df9b3718.tar.xz libjsonpp-49cec84ea856c40e3a3b1d2b99bac998df9b3718.zip |
Actually assert the array contentslibjsonpp-0.12.2
-rw-r--r-- | libjsonpp/testParse.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libjsonpp/testParse.cpp b/libjsonpp/testParse.cpp index 714cad4..70e3abb 100644 --- a/libjsonpp/testParse.cpp +++ b/libjsonpp/testParse.cpp @@ -69,7 +69,10 @@ BOOST_AUTO_TEST_CASE(parse_array) BOOST_AUTO_TEST_CASE(parse_array_of_strings) { const Glib::ustring val(" [ \"en\", \"de\", \"ro\", \"es\", \"fa\" ] "); - std::get<json::Array>(json::parseValue(val)); + const auto arr = std::get<json::Array>(json::parseValue(val)); + BOOST_REQUIRE_EQUAL(arr.size(), 5); + BOOST_CHECK_EQUAL(std::get<json::String>(arr.front()), "en"); + BOOST_CHECK_EQUAL(std::get<json::String>(arr.back()), "fa"); } BOOST_AUTO_TEST_CASE(parse_null) |