Skip to content

Commit

Permalink
Add test for reversed order nargs
Browse files Browse the repository at this point in the history
  • Loading branch information
hokacci committed Sep 15, 2021
1 parent 59cbf30 commit d5685bb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/test_positional_arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ TEST_CASE("Parse remaining arguments deemed positional" *
}
}

TEST_CASE("Reversed order nargs is not allowed" *
test_suite("positional_arguments")) {
argparse::ArgumentParser program("test");
REQUIRE_THROWS_AS(program.add_argument("output").nargs(2, 1), std::logic_error);
}

TEST_CASE("Square a number" * test_suite("positional_arguments")) {
argparse::ArgumentParser program;
program.add_argument("--verbose", "-v")
Expand Down

0 comments on commit d5685bb

Please sign in to comment.