aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Belikov <pavel.fuchs.belikov@gmail.com>2017-12-23 23:16:30 +0300
committerPavel Belikov <pavel.fuchs.belikov@gmail.com>2017-12-23 23:16:30 +0300
commitb8fc68ac37103a3b35d013ff10d0b623a3d6a75d (patch)
tree5391d4b0e55b25d4c909ff4e816dcb742132cf2f
parentfix subparsers completion (diff)
downloadargs.hxx-b8fc68ac37103a3b35d013ff10d0b623a3d6a75d.tar.xz
add more test cases
-rw-r--r--test.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/test.cxx b/test.cxx
index ffb475b..13cd4d0 100644
--- a/test.cxx
+++ b/test.cxx
@@ -1276,6 +1276,7 @@ TEST_CASE("Completion works as expected", "[args]")
args::Command c1(p2, "command1", "desc", [](args::Subparser &sp)
{
args::ValueFlag<std::string> f1(sp, "name", "description", {'f', "foo"}, "abc");
+ f1.KickOut();
sp.Parse();
});
@@ -1289,6 +1290,8 @@ TEST_CASE("Completion works as expected", "[args]")
REQUIRE_THROWS_WITH(p2.ParseArgs(std::vector<std::string>{"--completion", "bash", "1", "test", ""}), Equals("command1\ncommand2"));
REQUIRE_THROWS_WITH(p2.ParseArgs(std::vector<std::string>{"--completion", "bash", "2", "test", "command1", ""}), Equals("-f"));
REQUIRE_THROWS_WITH(p2.ParseArgs(std::vector<std::string>{"--completion", "bash", "2", "test", "command2", ""}), Equals("-b"));
+ REQUIRE_THROWS_WITH(p2.ParseArgs(std::vector<std::string>{"--completion", "bash", "2", "test", "command3", ""}), Equals(""));
+ REQUIRE_THROWS_WITH(p2.ParseArgs(std::vector<std::string>{"--completion", "bash", "3", "test", "command1", "-f", "-"}), Equals(""));
}
#undef ARGS_HXX