diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2011-01-28 12:22:37 +0100 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2011-01-28 12:22:37 +0100 |
commit | ab53c018fbc7aa01c0d89586c0aa98bc944dd9e4 (patch) | |
tree | 9519730babef80a667d935ec0d4b2e4c101afc34 /test/libapt | |
parent | 5d88572318ed7e271101b1ae8f2cc139a1a3f705 (diff) |
- download and use i18n/Index to choose which Translations to download
* apt-pkg/aptconfiguration.cc:
- remove the inbuilt Translation files whitelist
Diffstat (limited to 'test/libapt')
-rw-r--r-- | test/libapt/getlanguages_test.cc | 71 |
1 files changed, 40 insertions, 31 deletions
diff --git a/test/libapt/getlanguages_test.cc b/test/libapt/getlanguages_test.cc index 3559aae0c..707142aef 100644 --- a/test/libapt/getlanguages_test.cc +++ b/test/libapt/getlanguages_test.cc @@ -26,16 +26,18 @@ int main(int argc,char *argv[]) env[1] = ""; std::vector<std::string> vec = APT::Configuration::getLanguages(false, false, env); - equals(vec.size(), 2); - equals(vec[0], "de"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "de_DE"); + equals(vec[1], "de"); + equals(vec[2], "en"); // Special: Check if the cache is actually in use env[0] = "en_GB.UTF-8"; vec = APT::Configuration::getLanguages(false, true, env); - equals(vec.size(), 2); - equals(vec[0], "de"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "de_DE"); + equals(vec[1], "de"); + equals(vec[2], "en"); env[0] = "en_GB.UTF-8"; vec = APT::Configuration::getLanguages(false, false, env); @@ -52,19 +54,21 @@ int main(int argc,char *argv[]) env[0] = "tr_DE@euro"; vec = APT::Configuration::getLanguages(false, false, env); - equals(vec.size(), 2); - equals(vec[0], "tr"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "tr_DE"); + equals(vec[1], "tr"); + equals(vec[2], "en"); env[0] = "de_NO"; - env[1] = "se_NO:en_GB:nb_NO:nb:no_NO:no:nn_NO:nn:da:sv:en"; + env[1] = "de_NO:en_GB:nb_NO:nb:no_NO:no:nn_NO:nn:da:sv:en"; vec = APT::Configuration::getLanguages(false, false, env); - equals(vec.size(), 5); - equals(vec[0], "de"); - equals(vec[1], "en_GB"); - equals(vec[2], "nb"); - equals(vec[3], "no"); - equals(vec[4], "en"); + equals(vec.size(), 6); + equals(vec[0], "de_NO"); + equals(vec[1], "de"); + equals(vec[2], "en_GB"); + equals(vec[3], "nb_NO"); + equals(vec[4], "nb"); + equals(vec[5], "en"); env[0] = "pt_PR.UTF-8"; env[1] = ""; @@ -76,9 +80,10 @@ int main(int argc,char *argv[]) env[0] = "ast_DE.UTF-8"; vec = APT::Configuration::getLanguages(false, false, env); // bogus, but syntactical correct - equals(vec.size(), 2); - equals(vec[0], "ast"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "ast_DE"); + equals(vec[1], "ast"); + equals(vec[2], "en"); env[0] = "C"; vec = APT::Configuration::getLanguages(false, false, env); @@ -113,25 +118,28 @@ int main(int argc,char *argv[]) _config->Set("Acquire::Languages::2", "en"); env[0] = "de_DE.UTF-8"; vec = APT::Configuration::getLanguages(false, false, env); - equals(vec.size(), 2); - equals(vec[0], "de"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "de_DE"); + equals(vec[1], "de"); + equals(vec[2], "en"); _config->Set("Acquire::Languages::3", "de"); env[0] = "de_DE.UTF-8"; vec = APT::Configuration::getLanguages(false, false, env); - equals(vec.size(), 2); - equals(vec[0], "de"); - equals(vec[1], "en"); + equals(vec.size(), 3); + equals(vec[0], "de_DE"); + equals(vec[1], "de"); + equals(vec[2], "en"); _config->Set("Dir::State::lists", argv[1]); vec = APT::Configuration::getLanguages(true, false, env); - equals(vec.size(), 5); - equals(vec[0], "de"); - equals(vec[1], "en"); - equals(vec[2], "none"); - equals(vec[3], "pt"); - equals(vec[4], "tr"); + equals(vec.size(), 6); + equals(vec[0], "de_DE"); + equals(vec[1], "de"); + equals(vec[2], "en"); + equals(vec[3], "none"); + equals(vec[4], "pt"); + equals(vec[5], "tr"); _config->Set("Dir::State::lists", "/non-existing-dir"); _config->Set("Acquire::Languages::1", "none"); @@ -140,6 +148,7 @@ int main(int argc,char *argv[]) equals(vec.size(), 0); env[0] = "de_DE.UTF-8"; vec = APT::Configuration::getLanguages(true, false, env); + equals(vec.size(), 2); equals(vec[0], "en"); equals(vec[1], "de"); |