summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2020-08-29 20:01:00 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2020-08-29 20:01:00 +0100
commit49cec84ea856c40e3a3b1d2b99bac998df9b3718 (patch)
tree47a233b5801b11cd9db545f5eabbbc3ee903dd29
parentFix handling of empty object and object with nothing after a comma (diff)
downloadlibjsonpp-0.12.2.tar.bz2
libjsonpp-0.12.2.tar.xz
libjsonpp-0.12.2.zip
Actually assert the array contentslibjsonpp-0.12.2
-rw-r--r--libjsonpp/testParse.cpp5
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)