diff --git a/test.cpp b/test.cpp index 8b62aeb..7a40857 100644 --- a/test.cpp +++ b/test.cpp @@ -58,6 +58,28 @@ int main(int argc, char **argv) { std::cout << " - " << k.dump() << "\n"; } +#ifdef JSON11_COMMENTS + const string comment_test = R"({ + // comment + "a": 1, + // comment + // continued + "b": "text", + /* multi + line + comment */ + "c": [1, 2, 3] + })"; + + string err_comment; + auto json_comment = Json::parse(comment_test, err_comment); + if (!err_comment.empty()) { + printf("Failed: %s\n", err_comment.c_str()); + } else { + printf("Result: %s\n", json_comment.dump().c_str()); + } +#endif + std::list l1 { 1, 2, 3 }; std::vector l2 { 1, 2, 3 }; std::set l3 { 1, 2, 3 };