]> git.saurik.com Git - apt.git/blobdiff - test/libapt/configuration_test.cc
rename CleaAll() -> Clear()
[apt.git] / test / libapt / configuration_test.cc
index 5b23d17fbefafd8a28010c3cad59539ffb5c4747..5120e86c9c75d4ddaae0b11a173b601160aff1ab 100644 (file)
@@ -71,6 +71,19 @@ int main(int argc,const char *argv[]) {
        equals(Cnf.Find("APT2::Version", "33"), "33");
        equals(Cnf.FindI("APT2::Version", 33), 33);
 
+       equals(Cnf.FindFile("Dir::State"), "");
+       equals(Cnf.FindFile("Dir::Aptitude::State"), "");
+       Cnf.Set("Dir", "/srv/sid");
+       equals(Cnf.FindFile("Dir::State"), "");
+       Cnf.Set("Dir::State", "var/lib/apt");
+       Cnf.Set("Dir::Aptitude::State", "var/lib/aptitude");
+       equals(Cnf.FindFile("Dir::State"), "/srv/sid/var/lib/apt");
+       equals(Cnf.FindFile("Dir::Aptitude::State"), "/srv/sid/var/lib/aptitude");
+
+        Cnf.Set("Moo::Bar", "1");
+        Cnf.Clear();
+        equals(Cnf.Find("Moo::Bar"), "");
+
        //FIXME: Test for configuration file parsing;
        // currently only integration/ tests test them implicitly