]>
git.saurik.com Git - apt.git/blob - test/libapt/commandlineasstring_test.cc
3 #include <apt-pkg/cmndline.h>
4 #include <apt-pkg/configuration.h>
10 class CLT
: public CommandLine
{
13 std::string
static AsString(const char * const * const argv
,
14 unsigned int const argc
) {
15 std::string
const static conf
= "Commandline::AsString";
17 SaveInConfig(argc
, argv
);
18 return _config
->Find(conf
);
22 #define CMD(y,z) equals(CLT::AsString(argv, y), z);
26 const char* const argv
[] = {"apt-get", "install", "-sf"};
27 CMD(3, "apt-get install -sf");
30 const char* const argv
[] = {"apt-cache", "-s", "apt", "-so", "Debug::test=Test"};
31 CMD(5, "apt-cache -s apt -so Debug::test=Test");
34 const char* const argv
[] = {"apt-cache", "-s", "apt", "-so", "Debug::test=Das ist ein Test"};
35 CMD(5, "apt-cache -s apt -so Debug::test=\"Das ist ein Test\"");
38 const char* const argv
[] = {"apt-cache", "-s", "apt", "--hallo", "test=1.0"};
39 CMD(5, "apt-cache -s apt --hallo test=1.0");