]> git.saurik.com Git - apt.git/blobdiff - test/libapt/commandline_test.cc
* apt-pkg/contrib/cmdline.cc:
[apt.git] / test / libapt / commandline_test.cc
diff --git a/test/libapt/commandline_test.cc b/test/libapt/commandline_test.cc
new file mode 100644 (file)
index 0000000..a37fb02
--- /dev/null
@@ -0,0 +1,21 @@
+#include <apt-pkg/cmndline.h>
+
+#include "assert.h"
+
+int main()
+{
+   CommandLine::Args Args[] = {
+      { 't', 0, "Test::Worked", 0 },
+      { 'z', "zero", "Test::Zero", 0 },
+      {0,0,0,0}
+   };
+
+   CommandLine CmdL(Args,_config);
+   char const * argv[] = { "test", "--zero", "-t" };
+   CmdL.Parse(3 , argv);
+
+   equals(true, _config->FindB("Test::Worked", false));
+   equals(true, _config->FindB("Test::Zero", false));
+
+   return 0;
+}