add test for unfinished multi-line comment

This commit is contained in:
Antonio Cervone 2015-12-01 11:01:47 +01:00
parent c6c6fcfeff
commit f9833b1e7d

View File

@ -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<int> l1 { 1, 2, 3 };
std::vector<int> l2 { 1, 2, 3 };
std::set<int> l3 { 1, 2, 3 };