X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/d016834e39f668449385b1668240bdf905d62ade..2a49601f69e08f06fb2727d869d420daacdd09d5:/test/libapt/configuration_test.cc?ds=sidebyside diff --git a/test/libapt/configuration_test.cc b/test/libapt/configuration_test.cc index 5ec48834a..2c974ee0a 100644 --- a/test/libapt/configuration_test.cc +++ b/test/libapt/configuration_test.cc @@ -80,8 +80,26 @@ 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"); + Cnf.Set("Moo::Bar", "1"); - Cnf.ClearAll(); + Cnf.Clear(); equals(Cnf.Find("Moo::Bar"), ""); //FIXME: Test for configuration file parsing;