summaryrefslogtreecommitdiff
path: root/test/libapt/commandline_test.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-10-26 11:42:32 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2015-11-04 18:04:04 +0100
commit6079b276a959086ff18302cab752b6d7cfe5ad9f (patch)
tree151f75397170a05635202a604dd45d1fb9be85ca /test/libapt/commandline_test.cc
parent011188e3920f21e6883c2dab956b3d4fb4e8cbfa (diff)
move apts cmdline helper type into -private
Its not as simple as I initially thought to abstract this enough to make it globally usable, so lets not pollute global namespace with this for now. Git-Dch: Ignore
Diffstat (limited to 'test/libapt/commandline_test.cc')
-rw-r--r--test/libapt/commandline_test.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/libapt/commandline_test.cc b/test/libapt/commandline_test.cc
index 0da2ba45f..7f6c511df 100644
--- a/test/libapt/commandline_test.cc
+++ b/test/libapt/commandline_test.cc
@@ -17,18 +17,22 @@ class CLT: public CommandLine {
}
};
-#define EXPECT_CMD(x, ...) { const char * const argv[] = { __VA_ARGS__ }; EXPECT_EQ(x, CLT::AsString(argv, sizeof(argv)/sizeof(argv[0]))); }
+bool ShowHelp(CommandLine &, aptDispatchWithHelp const *) {return false;}
+std::vector<aptDispatchWithHelp> GetCommands() {return {};}
+
TEST(CommandLineTest,SaveInConfig)
{
- EXPECT_CMD("apt-get install -sf",
+#define APT_EXPECT_CMD(x, ...) { const char * const argv[] = { __VA_ARGS__ }; EXPECT_EQ(x, CLT::AsString(argv, sizeof(argv)/sizeof(argv[0]))); }
+ APT_EXPECT_CMD("apt-get install -sf",
"apt-get", "install", "-sf");
- EXPECT_CMD("apt-cache -s apt -so Debug::test=Test",
+ APT_EXPECT_CMD("apt-cache -s apt -so Debug::test=Test",
"apt-cache", "-s", "apt", "-so", "Debug::test=Test");
- EXPECT_CMD("apt-cache -s apt -so Debug::test=\"Das ist ein Test\"",
+ APT_EXPECT_CMD("apt-cache -s apt -so Debug::test=\"Das ist ein Test\"",
"apt-cache", "-s", "apt", "-so", "Debug::test=Das ist ein Test");
- EXPECT_CMD("apt-cache -s apt --hallo test=1.0",
+ APT_EXPECT_CMD("apt-cache -s apt --hallo test=1.0",
"apt-cache", "-s", "apt", "--hallo", "test=1.0");
+#undef APT_EXPECT_CMD
}
TEST(CommandLineTest,Parsing)
{