diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-08-01 16:42:22 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-08-02 01:01:41 +0300 |
commit | 6254448640530240dc9199bed60cd5568cbaf601 (patch) | |
tree | 4f859f61f1980bde1027fd3e22573157e9b5bd4b /tests/manifest-parser | |
parent | 12d0fb176edd8220f80f706d3fdc33431e178695 (diff) |
Add manifest_parser::split_comment() and manifest_serializer::merge_comment()
Diffstat (limited to 'tests/manifest-parser')
-rw-r--r-- | tests/manifest-parser/driver.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/manifest-parser/driver.cxx b/tests/manifest-parser/driver.cxx index e480508..037df96 100644 --- a/tests/manifest-parser/driver.cxx +++ b/tests/manifest-parser/driver.cxx @@ -130,6 +130,23 @@ main () {{"","1"},{"a","x\\"},{"b",""},{"",""},{"",""}})); assert (test (":1\na:\\\nx\\\\\\\n\\\nb:", {{"","1"},{"a","x\\\\"},{"b",""},{"",""},{"",""}})); + + // Manifest value splitting (into the value/comment pair). + // + { + auto p (manifest_parser::split_comment ("value\\; text ; comment text")); + assert (p.first == "value; text" && p.second == "comment text"); + } + + { + auto p (manifest_parser::split_comment ("value")); + assert (p.first == "value" && p.second == ""); + } + + { + auto p (manifest_parser::split_comment ("; comment")); + assert (p.first == "" && p.second == "comment"); + } } static ostream& |