From 57de9467f50a94855f242ec8b4522d995c2cf9d7 Mon Sep 17 00:00:00 2001 From: Andreev Gregory Date: Fri, 16 Aug 2024 00:01:30 +0300 Subject: [PATCH] ... --- src/library/jsonincpp/quality_of_life.cpp | 4 ++-- src/tests/test0.cpp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/library/jsonincpp/quality_of_life.cpp b/src/library/jsonincpp/quality_of_life.cpp index 60c7747..966613b 100644 --- a/src/library/jsonincpp/quality_of_life.cpp +++ b/src/library/jsonincpp/quality_of_life.cpp @@ -72,13 +72,13 @@ namespace json { const std::vector& JSON::asArray() const { if (isArray()) - return static_cast(value)->data; + return static_cast(value)->data; throw misuse("json obj is not array"); } const std::map& JSON::asDictionary() const { if (isDictionary()) - return static_cast(value)->data; + return static_cast(value)->data; throw misuse("json obj is not dictionary"); } diff --git a/src/tests/test0.cpp b/src/tests/test0.cpp index acf07aa..004c110 100644 --- a/src/tests/test0.cpp +++ b/src/tests/test0.cpp @@ -35,6 +35,11 @@ void test_obvious(const JSON& A) { } int main() { + json::JSON cba; + cba["boba"] = json::JSON("<>"); + printf("%s\n", generate_str(cba["boba"].g(), print_compact).c_str()); + // return 0; + test_obvious(parse_str_flawless("{ \"aaa\": true, \"2\":[true]}")); test_obvious(parse_str_flawless("{ \"aa\": true, \"tttt\": [true, false]}")); test_obvious(parse_str_flawless("[[[]]]"));