mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-01 05:03:52 +00:00
More tests
This commit is contained in:
parent
03307dcb0b
commit
051841f21c
@ -197,6 +197,7 @@ TEST(THelp, ExcludesPositional) {
|
||||
EXPECT_THAT(help, HasSubstr("Positionals:"));
|
||||
EXPECT_THAT(help, HasSubstr("Excludes: op1"));
|
||||
}
|
||||
|
||||
TEST(THelp, Subcom) {
|
||||
CLI::App app{"My prog"};
|
||||
|
||||
@ -214,6 +215,14 @@ TEST(THelp, Subcom) {
|
||||
help = sub1->help();
|
||||
EXPECT_THAT(help, HasSubstr("Usage: sub1"));
|
||||
|
||||
char x[] = "./myprogram";
|
||||
char y[] = "sub2";
|
||||
|
||||
std::vector<char*> args = {x,y};
|
||||
app.parse(args.size(), args.data());
|
||||
|
||||
help = app.help();
|
||||
EXPECT_THAT(help, HasSubstr("Usage: ./myprogram sub2"));
|
||||
}
|
||||
|
||||
TEST(THelp, IntDefaults) {
|
||||
|
@ -405,6 +405,21 @@ TEST_F(TApp, IniFlagNumbers) {
|
||||
EXPECT_THROW(run(), CLI::ConversionError);
|
||||
}
|
||||
|
||||
TEST_F(TApp, IniFlagDual) {
|
||||
|
||||
TempFile tmpini{"TestIniTmp.ini"};
|
||||
|
||||
bool boo;
|
||||
app.add_flag("--flag", boo);
|
||||
app.add_config("--config", tmpini);
|
||||
|
||||
{
|
||||
std::ofstream out{tmpini};
|
||||
out << "flag=1 1" << std::endl;
|
||||
}
|
||||
|
||||
EXPECT_THROW(run(), CLI::ConversionError);
|
||||
}
|
||||
|
||||
TEST_F(TApp, IniFlagText) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user