diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2012-04-25 17:02:24 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2012-04-25 17:02:24 +0200 |
commit | 99b4fefe0f303cf5ae5e8b9116404fc0fcc96e47 (patch) | |
tree | 1a3b69e8d10cbf78a7ad278dab0e5b40bf24c69f /test/libapt/configuration_test.cc | |
parent | 4d74894b85227f42b65a84f459f011d74946e4f4 (diff) | |
parent | cc04f4ce9eaaf0945775d5233806de7da5d21ff6 (diff) |
merged from donkult
Diffstat (limited to 'test/libapt/configuration_test.cc')
-rw-r--r-- | test/libapt/configuration_test.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/libapt/configuration_test.cc b/test/libapt/configuration_test.cc index 9a3e2c118..87d5699ef 100644 --- a/test/libapt/configuration_test.cc +++ b/test/libapt/configuration_test.cc @@ -80,6 +80,24 @@ 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"); + + Cnf.Set("Dir::State", "/dev/null"); + Cnf.Set("Dir::State::lists", "lists/"); + equals(Cnf.FindDir("Dir::State"), "/rootdir/dev/null"); + equals(Cnf.FindDir("Dir::State::lists"), "/rootdir/dev/null"); + //FIXME: Test for configuration file parsing; // currently only integration/ tests test them implicitly |