1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-05-07 23:33:52 +00:00

Adding two more lines to tests

This commit is contained in:
Henry Fredrick Schreiner 2017-03-14 20:20:03 -04:00
parent d857b24786
commit 365315dfdd

View File

@ -139,3 +139,31 @@ TEST_F(TApp, IncorrectConstructionExcludesCannotFind) {
auto cat = app.add_flag("--cat");
EXPECT_THROW(cat->excludes("--nothing"),CLI::IncorrectConstruction);
}
TEST_F(TApp, IncorrectConstructionDuplicateRequires) {
auto cat = app.add_flag("--cat");
auto other = app.add_flag("--other");
ASSERT_NO_THROW(cat->requires(other));
EXPECT_THROW(cat->requires(other),CLI::OptionAlreadyAdded);
}
TEST_F(TApp, IncorrectConstructionDuplicateRequiresTxt) {
auto cat = app.add_flag("--cat");
auto other = app.add_flag("--other");
ASSERT_NO_THROW(cat->requires("--other"));
EXPECT_THROW(cat->requires("--other"),CLI::OptionAlreadyAdded);
}
TEST_F(TApp, IncorrectConstructionDuplicateExcludes) {
auto cat = app.add_flag("--cat");
auto other = app.add_flag("--other");
ASSERT_NO_THROW(cat->excludes(other));
EXPECT_THROW(cat->excludes(other),CLI::OptionAlreadyAdded);
}
TEST_F(TApp, IncorrectConstructionDuplicateExcludesTxt) {
auto cat = app.add_flag("--cat");
auto other = app.add_flag("--other");
ASSERT_NO_THROW(cat->excludes("--other"));
EXPECT_THROW(cat->excludes("--other"),CLI::OptionAlreadyAdded);
}