]> git.saurik.com Git - apt.git/blobdiff - test/libapt/getlanguages_test.cc
add default and override handling for Cnf::FindVector
[apt.git] / test / libapt / getlanguages_test.cc
index 274cf4aa400c95662e5fc621f37f4b77c4969a69..51cfecee321ed3990ccc1b7ed34fb1ba28b08bc8 100644 (file)
@@ -105,6 +105,14 @@ int main(int argc,char *argv[])
        vec = APT::Configuration::getLanguages(false, false, env);
        equals(vec.size(), 1);
        equals(vec[0], "fr");
+
+       _config->Set("Acquire::Languages", "environment,en");
+       env[0] = "de_DE.UTF-8";
+       vec = APT::Configuration::getLanguages(false, false, env);
+       equals(vec.size(), 3);
+       equals(vec[0], "de_DE");
+       equals(vec[1], "de");
+       equals(vec[2], "en");
        _config->Set("Acquire::Languages", "");
 
        _config->Set("Acquire::Languages::1", "environment");
@@ -144,7 +152,8 @@ int main(int argc,char *argv[])
 
        _config->Set("Acquire::Languages", "none");
        vec = APT::Configuration::getLanguages(true, false, env);
-       equals(vec.size(), 0);
+       equals(vec.size(), 1);
+       equals(vec[0], "none");
        _config->Set("Acquire::Languages", "");
 
        _config->Set("Dir::State::lists", "/non-existing-dir");
@@ -168,7 +177,8 @@ int main(int argc,char *argv[])
        _config->Set("Acquire::Languages", "none");
        env[0] = "de_DE.UTF-8";
        vec = APT::Configuration::getLanguages(true, false, env);
-       equals(vec.size(), 0);
+       equals(vec.size(), 1);
+       equals(vec[0], "none");
 
        _config->Set("Acquire::Languages", "");
        //FIXME: Remove support for this deprecated setting