]>
git.saurik.com Git - apt.git/blob - test/libapt/commandlineasstring_test.cc
1 #include <apt-pkg/cmndline.h>
2 #include <apt-pkg/configuration.h>
8 class CLT
: public CommandLine
{
11 std::string
static AsString(const char * const * const argv
,
12 unsigned int const argc
) {
13 std::string
const static conf
= "Commandline::AsString";
15 SaveInConfig(argc
, argv
);
16 return _config
->Find(conf
);
20 #define CMD(y,z) equals(CLT::AsString(argv, y), z);
24 const char* const argv
[] = {"apt-get", "install", "-sf"};
25 CMD(3, "apt-get install -sf");
28 const char* const argv
[] = {"apt-cache", "-s", "apt", "-so", "Debug::test=Test"};
29 CMD(5, "apt-cache -s apt -so Debug::test=Test");
32 const char* const argv
[] = {"apt-cache", "-s", "apt", "-so", "Debug::test=Das ist ein Test"};
33 CMD(5, "apt-cache -s apt -so Debug::test=\"Das ist ein Test\"");
36 const char* const argv
[] = {"apt-cache", "-s", "apt", "--hallo", "test=1.0"};
37 CMD(5, "apt-cache -s apt --hallo test=1.0");