mirror of
https://github.com/CLIUtils/CLI11.git
synced 2025-05-06 07:03:52 +00:00
Adding remove_option check on config
This commit is contained in:
parent
c4d0fc1a07
commit
194284c24b
@ -208,6 +208,28 @@ TEST_F(TApp, IniRequiredNotFound) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST_F(TApp, IniOverwrite) {
|
||||||
|
|
||||||
|
TempFile tmpini{"TestIniTmp.ini"};
|
||||||
|
{
|
||||||
|
std::ofstream out{tmpini};
|
||||||
|
out << "[default]" << std::endl;
|
||||||
|
out << "two=99" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string orig = "filename_not_exist.ini";
|
||||||
|
std::string next = "TestIniTmp.ini";
|
||||||
|
app.add_config("--config", orig);
|
||||||
|
// Make sure this can be overwritten
|
||||||
|
app.add_config("--conf", next);
|
||||||
|
int two = 7;
|
||||||
|
app.add_option("--two", two);
|
||||||
|
|
||||||
|
run();
|
||||||
|
|
||||||
|
EXPECT_EQ(99, two);
|
||||||
|
}
|
||||||
|
|
||||||
TEST_F(TApp, IniRequired) {
|
TEST_F(TApp, IniRequired) {
|
||||||
|
|
||||||
TempFile tmpini{"TestIniTmp.ini"};
|
TempFile tmpini{"TestIniTmp.ini"};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user