diff --git a/test/test_mutually_exclusive_group.cpp b/test/test_mutually_exclusive_group.cpp index 493f58a..b1162e3 100644 --- a/test/test_mutually_exclusive_group.cpp +++ b/test/test_mutually_exclusive_group.cpp @@ -36,4 +36,19 @@ TEST_CASE( program_copy.parse_args({"test", "--first", "1", "--second", "2"}), "Argument '--second VAR' not allowed with '--first VAR'", std::runtime_error); +} + +TEST_CASE("Create mutually exclusive group with 3 arguments" * + test_suite("mutex_args")) { + argparse::ArgumentParser program("test"); + + auto &group = program.add_mutually_exclusive_group(); + group.add_argument("--first"); + group.add_argument("--second"); + group.add_argument("--third"); + + REQUIRE_THROWS_WITH_AS( + program.parse_args({"test", "--first", "1", "--third", "2"}), + "Argument '--third VAR' not allowed with '--first VAR'", + std::runtime_error); } \ No newline at end of file