X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/ae2be086c6996e6ed02b7d828fdcac38248a964d..488011fa99aee25bedb39ae2cc3115ad1ab000c0:/test/libapt/commandline_test.cc diff --git a/test/libapt/commandline_test.cc b/test/libapt/commandline_test.cc index a37fb0220..de8a30bd6 100644 --- a/test/libapt/commandline_test.cc +++ b/test/libapt/commandline_test.cc @@ -9,13 +9,24 @@ int main() { 'z', "zero", "Test::Zero", 0 }, {0,0,0,0} }; - CommandLine CmdL(Args,_config); + char const * argv[] = { "test", "--zero", "-t" }; CmdL.Parse(3 , argv); - equals(true, _config->FindB("Test::Worked", false)); equals(true, _config->FindB("Test::Zero", false)); + _config->Clear("Test"); + equals(false, _config->FindB("Test::Worked", false)); + equals(false, _config->FindB("Test::Zero", false)); + + _config->Set("Test::Zero", true); + equals(true, _config->FindB("Test::Zero", false)); + + char const * argv2[] = { "test", "--no-zero", "-t" }; + CmdL.Parse(3 , argv2); + equals(true, _config->FindB("Test::Worked", false)); + equals(false, _config->FindB("Test::Zero", false)); + return 0; }