From f9833b1e7d4b36901c36131c4699d889dae3eaf2 Mon Sep 17 00:00:00 2001 From: Antonio Cervone Date: Tue, 1 Dec 2015 11:01:47 +0100 Subject: [PATCH] add test for unfinished multi-line comment --- test.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test.cpp b/test.cpp index 1e537b9..ece0e04 100644 --- a/test.cpp +++ b/test.cpp @@ -127,6 +127,17 @@ int main(int argc, char **argv) { printf("Result: %s\n", json_failing_comment.dump().c_str()); } + failing_comment_test = R"({/* bad + comment *})"; + + json_failing_comment = Json::parse( + failing_comment_test, err_failing_comment, /*detect_comments=*/ true); + if (!err_failing_comment.empty()) { + printf("Failed: %s\n", err_failing_comment.c_str()); + } else { + printf("Result: %s\n", json_failing_comment.dump().c_str()); + } + std::list l1 { 1, 2, 3 }; std::vector l2 { 1, 2, 3 }; std::set l3 { 1, 2, 3 };