summaryrefslogtreecommitdiff
path: root/test/libapt/configuration_test.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-04-23 19:11:11 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-04-23 19:11:11 +0200
commitec76891fa17c77f8fd28b9b6e11ef2d7547afe7e (patch)
tree76eea11b157ce2b0094c370d7d9e2e6e08cffab7 /test/libapt/configuration_test.cc
parentecdc4e74bc5ba7eadeff3276bc3707c127d9989c (diff)
normalize a bit by replacing // and /./ with / in FindFile
Diffstat (limited to 'test/libapt/configuration_test.cc')
-rw-r--r--test/libapt/configuration_test.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/libapt/configuration_test.cc b/test/libapt/configuration_test.cc
index 9a3e2c118..6b657a70c 100644
--- a/test/libapt/configuration_test.cc
+++ b/test/libapt/configuration_test.cc
@@ -80,6 +80,19 @@ int main(int argc,const char *argv[]) {
equals(Cnf.FindFile("Dir::State"), "/srv/sid/var/lib/apt");
equals(Cnf.FindFile("Dir::Aptitude::State"), "/srv/sid/var/lib/aptitude");
+ Cnf.Set("RootDir", "/");
+ equals(Cnf.FindFile("Dir::State"), "/srv/sid/var/lib/apt");
+ equals(Cnf.FindFile("Dir::Aptitude::State"), "/srv/sid/var/lib/aptitude");
+ Cnf.Set("RootDir", "//./////.////");
+ equals(Cnf.FindFile("Dir::State"), "/srv/sid/var/lib/apt");
+ equals(Cnf.FindFile("Dir::Aptitude::State"), "/srv/sid/var/lib/aptitude");
+ Cnf.Set("RootDir", "/rootdir");
+ equals(Cnf.FindFile("Dir::State"), "/rootdir/srv/sid/var/lib/apt");
+ equals(Cnf.FindFile("Dir::Aptitude::State"), "/rootdir/srv/sid/var/lib/aptitude");
+ Cnf.Set("RootDir", "/rootdir/");
+ equals(Cnf.FindFile("Dir::State"), "/rootdir/srv/sid/var/lib/apt");
+ equals(Cnf.FindFile("Dir::Aptitude::State"), "/rootdir/srv/sid/var/lib/aptitude");
+
//FIXME: Test for configuration file parsing;
// currently only integration/ tests test them implicitly