1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-30 04:33:53 +00:00

Check that no change doesn't throw

This commit is contained in:
Henry Fredrick Schreiner 2017-11-26 12:02:53 -05:00 committed by Henry Schreiner
parent e26fcd2470
commit 88c680a12b

View File

@ -125,13 +125,16 @@ TEST_F(TApp, IncorrectConstructionFlagPositional3) {
TEST_F(TApp, IncorrectConstructionFlagExpected) {
auto cat = app.add_flag("--cat");
EXPECT_NO_THROW(cat->expected(0));
EXPECT_THROW(cat->expected(1), CLI::IncorrectConstruction);
}
TEST_F(TApp, IncorrectConstructionOptionAsFlag) {
int x;
auto cat = app.add_option("--cat", x);
EXPECT_NO_THROW(cat->expected(1));
EXPECT_THROW(cat->expected(0), CLI::IncorrectConstruction);
EXPECT_THROW(cat->expected(2), CLI::IncorrectConstruction);
}
TEST_F(TApp, IncorrectConstructionOptionAsVector) {