From c6c6fcfeff5663cb34e7405bcc4572a2a5424d40 Mon Sep 17 00:00:00 2001 From: Antonio Cervone Date: Tue, 1 Dec 2015 11:01:27 +0100 Subject: [PATCH] add test for inline comment without trailing newline --- test.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test.cpp b/test.cpp index 7e7d0e3..1e537b9 100644 --- a/test.cpp +++ b/test.cpp @@ -105,6 +105,16 @@ 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()); + } + failing_comment_test = R"({ "a": 1 }/)";