Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RAII #36

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
7 changes: 4 additions & 3 deletions cmdparser.Test/tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ TEST_CASE( "Parse help", "[help]" ) {
"--help"
};

Parser parser(2, args);
ParserWithPolicy<NoExit> parser(2, args);
const auto value = parser.run(output, errors);
const std::string prefix = "Available parameters:";

REQUIRE(parser.has_help() == true);
REQUIRE(parser.app_name() == "myapp");
REQUIRE(value == false);
REQUIRE(output.str().substr(0, prefix.size()) == prefix);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry cannot accept PRs that break / change existing tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that testcase never been reached beforehand anyway as exit() is called?

// true as it met all required arguments.
REQUIRE(value == true);
REQUIRE(output.str().find(prefix) != std::string::npos);
}

TEST_CASE( "No help", "[help]" ) {
Expand Down
Loading