mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 07:04:39 +00:00
Restore a "remaining" test case for compat
This commit is contained in:
parent
14abaa47d9
commit
6dfaa1c20c
@ -88,10 +88,10 @@ TEST_CASE("Parse optional arguments of many values" *
|
||||
program.add_argument("-i").remaining().scan<'i', int>();
|
||||
|
||||
WHEN("provided no argument") {
|
||||
THEN("the program accepts it and gets empty container") {
|
||||
THEN("the program accepts it bug gets nothing") {
|
||||
REQUIRE_NOTHROW(program.parse_args({"test"}));
|
||||
auto inputs = program.get<std::vector<int>>("-i");
|
||||
REQUIRE(inputs.size() == 0);
|
||||
REQUIRE_THROWS_AS(program.get<std::vector<int>>("-i"),
|
||||
std::logic_error);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -193,11 +193,10 @@ TEST_CASE("Parse remaining arguments deemed positional" *
|
||||
program.add_argument("input").remaining();
|
||||
|
||||
WHEN("provided no argument") {
|
||||
THEN("the program accepts it and gets empty container") {
|
||||
THEN("the program accepts it but gets nothing") {
|
||||
REQUIRE_NOTHROW(program.parse_args({"test"}));
|
||||
|
||||
auto inputs = program.get<std::vector<std::string>>("input");
|
||||
REQUIRE(inputs.size() == 0);
|
||||
REQUIRE_THROWS_AS(program.get<std::vector<std::string>>("input"),
|
||||
std::logic_error);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user