]>
git.saurik.com Git - apt.git/blob - test/libapt/commandline_test.cc
1 #include <apt-pkg/cmndline.h>
7 CommandLine::Args Args
[] = {
8 { 't', 0, "Test::Worked", 0 },
9 { 'z', "zero", "Test::Zero", 0 },
12 CommandLine
CmdL(Args
,_config
);
14 char const * argv
[] = { "test", "--zero", "-t" };
16 equals(true, _config
->FindB("Test::Worked", false));
17 equals(true, _config
->FindB("Test::Zero", false));
19 _config
->Clear("Test");
20 equals(false, _config
->FindB("Test::Worked", false));
21 equals(false, _config
->FindB("Test::Zero", false));
23 _config
->Set("Test::Zero", true);
24 equals(true, _config
->FindB("Test::Zero", false));
26 char const * argv2
[] = { "test", "--no-zero", "-t" };
27 CmdL
.Parse(3 , argv2
);
28 equals(true, _config
->FindB("Test::Worked", false));
29 equals(false, _config
->FindB("Test::Zero", false));