aboutsummaryrefslogtreecommitdiff
path: root/tests/manifest-roundtrip/driver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manifest-roundtrip/driver.cxx')
-rw-r--r--tests/manifest-roundtrip/driver.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/manifest-roundtrip/driver.cxx b/tests/manifest-roundtrip/driver.cxx
index 5dc5862..c63a729 100644
--- a/tests/manifest-roundtrip/driver.cxx
+++ b/tests/manifest-roundtrip/driver.cxx
@@ -22,11 +22,16 @@ using namespace butl;
// -m
// Serialize multi-line manifest values using the v2 form.
//
+// -s
+// Split values into the value/comment pairs and merge them back before
+// printing.
+//
int
main (int argc, const char* argv[])
try
{
bool multiline_v2 (false);
+ bool split (false);
for (int i (1); i != argc; ++i)
{
@@ -34,6 +39,8 @@ try
if (v == "-m")
multiline_v2 = true;
+ else if (v == "-s")
+ split = true;
}
// Read/write in binary mode.
@@ -61,6 +68,12 @@ try
else
eom = false;
+ if (split)
+ {
+ const auto& vc (manifest_parser::split_comment (nv.value));
+ nv.value = manifest_serializer::merge_comment (vc.first, vc.second);
+ }
+
s.next (nv.name, nv.value);
}
}