]>
git.saurik.com Git - apt.git/blob - test/libapt/commandline_test.cc
3 #include <apt-pkg/cmndline.h>
4 #include <apt-pkg/configuration.h>
10 CommandLine::Args Args
[] = {
11 { 't', 0, "Test::Worked", 0 },
12 { 'z', "zero", "Test::Zero", 0 },
15 CommandLine
CmdL(Args
,_config
);
17 char const * argv
[] = { "test", "--zero", "-t" };
19 equals(true, _config
->FindB("Test::Worked", false));
20 equals(true, _config
->FindB("Test::Zero", false));
22 _config
->Clear("Test");
23 equals(false, _config
->FindB("Test::Worked", false));
24 equals(false, _config
->FindB("Test::Zero", false));
26 _config
->Set("Test::Zero", true);
27 equals(true, _config
->FindB("Test::Zero", false));
29 char const * argv2
[] = { "test", "--no-zero", "-t" };
30 CmdL
.Parse(3 , argv2
);
31 equals(true, _config
->FindB("Test::Worked", false));
32 equals(false, _config
->FindB("Test::Zero", false));