From b8fc68ac37103a3b35d013ff10d0b623a3d6a75d Mon Sep 17 00:00:00 2001 From: Pavel Belikov Date: Sat, 23 Dec 2017 23:16:30 +0300 Subject: add more test cases --- test.cxx | 3 +++ 1 file changed, 3 insertions(+) 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 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{"--completion", "bash", "1", "test", ""}), Equals("command1\ncommand2")); REQUIRE_THROWS_WITH(p2.ParseArgs(std::vector{"--completion", "bash", "2", "test", "command1", ""}), Equals("-f")); REQUIRE_THROWS_WITH(p2.ParseArgs(std::vector{"--completion", "bash", "2", "test", "command2", ""}), Equals("-b")); + REQUIRE_THROWS_WITH(p2.ParseArgs(std::vector{"--completion", "bash", "2", "test", "command3", ""}), Equals("")); + REQUIRE_THROWS_WITH(p2.ParseArgs(std::vector{"--completion", "bash", "3", "test", "command1", "-f", "-"}), Equals("")); } #undef ARGS_HXX -- cgit v1.2.1