From 01955238036ac546ba1e488546101f65d213f4dd Mon Sep 17 00:00:00 2001 From: Pavel Belikov Date: Tue, 14 Nov 2017 21:33:31 +0300 Subject: add leading whitespace support in Wrap --- test.cxx | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'test.cxx') diff --git a/test.cxx b/test.cxx index 2c4cd6e..991d98e 100644 --- a/test.cxx +++ b/test.cxx @@ -968,7 +968,7 @@ TEST_CASE("HelpParams work as expected", "[args]") { args::ArgumentParser p("parser"); args::ValueFlag f(p, "name", "description", {'f', "foo"}); - args::ValueFlag g(p, "name", "description", {'g'}); + args::ValueFlag g(p, "name", "description\n d1\n d2", {'g'}); p.Prog("prog"); REQUIRE(p.Help() == R"( prog {OPTIONS} @@ -979,6 +979,8 @@ TEST_CASE("HelpParams work as expected", "[args]") -f[name], --foo=[name] description -g[name] description + d1 + d2 )"); @@ -993,6 +995,8 @@ TEST_CASE("HelpParams work as expected", "[args]") -f, --foo [name] description -g[name] description + d1 + d2 )"); @@ -1004,6 +1008,8 @@ TEST_CASE("HelpParams work as expected", "[args]") -f, --foo description -g description + d1 + d2 )"); @@ -1018,6 +1024,8 @@ TEST_CASE("HelpParams work as expected", "[args]") -f, --foo description -g description + d1 + d2 )"); @@ -1032,8 +1040,30 @@ TEST_CASE("HelpParams work as expected", "[args]") description -g description + d1 + d2 )"); + + args::ValueFlag e(p, "name", "some reaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaally loooooooooooooooooooooooooooong description", {'e'}); + REQUIRE(p.Help() == R"( usage: prog {OPTIONS} + + parser + + Options + + -f, --foo + description + -g + description + d1 + d2 + -e + some reaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaally + loooooooooooooooooooooooooooong description + +)"); + } #undef ARGS_HXX -- cgit v1.2.1