diff options
author | Pavel Belikov <pavel.fuchs.belikov@gmail.com> | 2017-12-23 23:16:30 +0300 |
---|---|---|
committer | Pavel Belikov <pavel.fuchs.belikov@gmail.com> | 2017-12-23 23:16:30 +0300 |
commit | b8fc68ac37103a3b35d013ff10d0b623a3d6a75d (patch) | |
tree | 5391d4b0e55b25d4c909ff4e816dcb742132cf2f | |
parent | fix subparsers completion (diff) | |
download | args.hxx-b8fc68ac37103a3b35d013ff10d0b623a3d6a75d.tar.xz |
add more test cases
-rw-r--r-- | test.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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 |