]> git.saurik.com Git - apt.git/blobdiff - test/libapt/commandline_test.cc
clear HitEof flag in FileFd::Seek
[apt.git] / test / libapt / commandline_test.cc
index a37fb022023392955a12d428e21c1fac98565498..d8c5bc5bd6b3b081e91c06cd63cd06a30fb88d29 100644 (file)
@@ -1,4 +1,7 @@
+#include <config.h>
+
 #include <apt-pkg/cmndline.h>
+#include <apt-pkg/configuration.h>
 
 #include "assert.h"
 
@@ -9,13 +12,24 @@ int main()
       { '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));
 
+   _config->Clear("Test");
+   equals(false, _config->FindB("Test::Worked", false));
+   equals(false, _config->FindB("Test::Zero", false));
+
+   _config->Set("Test::Zero", true);
+   equals(true, _config->FindB("Test::Zero", false));
+
+   char const * argv2[] = { "test", "--no-zero", "-t" };
+   CmdL.Parse(3 , argv2);
+   equals(true, _config->FindB("Test::Worked", false));
+   equals(false, _config->FindB("Test::Zero", false));
+
    return 0;
 }