mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 15:14:39 +00:00
Minor update to positional argument test
This commit is contained in:
parent
63a6763489
commit
2143c7140b
@ -62,8 +62,8 @@ TEST_CASE("Square a number", "[positional_arguments]") {
|
||||
|
||||
program.add_argument("square")
|
||||
.help("display a square of a given number")
|
||||
.action([](const std::string& value) { auto integer = std::stoi(value); return integer * integer; });
|
||||
.action([](const std::string& value) { return pow(std::stoi(value), 2); });
|
||||
|
||||
program.parse_args({"./main", "15"});
|
||||
REQUIRE(program.get<int>("square") == 225);
|
||||
REQUIRE(program.get<double>("square") == 225);
|
||||
}
|
Loading…
Reference in New Issue
Block a user