From 064536ef079051dd0af53b7f311bef4aa4670ccb Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 5 Jul 2024 22:00:57 +0300 Subject: Serialize manifest using new-fashioned multi-line mode introducer (as in 'foo:\') --- tests/manifest-roundtrip/driver.cxx | 13 ++++--------- tests/manifest-roundtrip/testscript | 26 +++++++++++++++++--------- 2 files changed, 21 insertions(+), 18 deletions(-) (limited to 'tests/manifest-roundtrip') diff --git a/tests/manifest-roundtrip/driver.cxx b/tests/manifest-roundtrip/driver.cxx index c63a729..2aa4120 100644 --- a/tests/manifest-roundtrip/driver.cxx +++ b/tests/manifest-roundtrip/driver.cxx @@ -19,9 +19,6 @@ using namespace butl; // // Round-trip a manifest reading it from stdin and printing to stdout. // -// -m -// Serialize multi-line manifest values using the v2 form. -// // -s // Split values into the value/comment pairs and merge them back before // printing. @@ -30,17 +27,16 @@ int main (int argc, const char* argv[]) try { - bool multiline_v2 (false); bool split (false); for (int i (1); i != argc; ++i) { string v (argv[i]); - if (v == "-m") - multiline_v2 = true; - else if (v == "-s") + if (v == "-s") split = true; + else + assert (false); } // Read/write in binary mode. @@ -53,8 +49,7 @@ try manifest_serializer s (cout, "stdout", false /* long_lines */, - {} /* filter */, - multiline_v2); + {} /* filter */); for (bool eom (true), eos (false); !eos; ) { diff --git a/tests/manifest-roundtrip/testscript b/tests/manifest-roundtrip/testscript index a228b0f..4373fa1 100644 --- a/tests/manifest-roundtrip/testscript +++ b/tests/manifest-roundtrip/testscript @@ -13,7 +13,8 @@ $* <>EOF description: A very very very very very very very very very very very very\ very very very very very very very very very very very very very very very\ very very long description. - changes:\ + changes: + \ 1.0.1 - Fixed a very very very very very very very very very very very very very\ very annoying bug. @@ -32,7 +33,8 @@ $* <>EOF requires: c++11 : path: c:\windows\\ - path:\ + path: + \ c:\windows\\ \ @@ -40,7 +42,7 @@ $* <>EOF : multiline-v2 : -$* -m <>EOF +$* <>EOF : 1 name: libbpkg version: 1.0.1 @@ -81,35 +83,41 @@ $* -m <>EOF : $* -s <>EOF : 1 - info:\ + info: + \ value text \ - info:\ + info: + \ value text ; comment \ - info:\ + info: + \ ; comment text \ - info:\ + info: + \ value \; \\ ; comment \ - info:\ + info: + \ value \\; ; comment \ - info:\ + info: + \ value \\\\; ; -- cgit v1.1