Added printing of comments to *.actual test files
This enables testing of comment-handling code. Updated *.expected test
result files to account for printing of comments.
diff --git a/src/jsontestrunner/main.cpp b/src/jsontestrunner/main.cpp
index 338167e..ba98587 100644
--- a/src/jsontestrunner/main.cpp
+++ b/src/jsontestrunner/main.cpp
@@ -61,6 +61,9 @@
static void
printValueTree(FILE* fout, Json::Value& value, const std::string& path = ".") {
+ if (value.hasComment(Json::commentBefore)) {
+ fprintf(fout, "%s\n", value.getComment(Json::commentBefore).c_str());
+ }
switch (value.type()) {
case Json::nullValue:
fprintf(fout, "%s=null\n", path.c_str());
@@ -117,6 +120,10 @@
default:
break;
}
+
+ if (value.hasComment(Json::commentAfter)) {
+ fprintf(fout, "%s\n", value.getComment(Json::commentAfter).c_str());
+ }
}
static int parseAndSaveValueTree(const std::string& input,