mirror of
https://github.com/KeqingMoe/argparse.git
synced 2025-07-04 15:14:39 +00:00
Because program.parse_args( { "test", "--version" }) calls std::exit(0), the REQUIRE line never runs and this test is less useful. Because tests execution stops here, the doctest status report is not output. If --version can be made to not exit during this test, then the test could be restored. Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
14 lines
395 B
C++
14 lines
395 B
C++
#include <doctest.hpp>
|
|
#include <argparse/argparse.hpp>
|
|
|
|
using doctest::test_suite;
|
|
|
|
TEST_CASE("Users can print version and exit" * test_suite("version")
|
|
* doctest::skip()) {
|
|
argparse::ArgumentParser program("cli-test", "1.9.0");
|
|
program.add_argument("-d", "--dir")
|
|
.required();
|
|
program.parse_args( { "test", "--version" });
|
|
REQUIRE(program.get("--version") == "1.9.0");
|
|
}
|