X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/9982862925627d4714ed8b61d8b591950ed5aaa5..4075cf25caf365f89c12b9c02f1e013a0cc2776a:/t/po.t diff --git a/t/po.t b/t/po.t index da0bd68a7..0db56edc9 100755 --- a/t/po.t +++ b/t/po.t @@ -17,7 +17,7 @@ BEGIN { } } -use Test::More tests => 109; +use Test::More tests => 114; BEGIN { use_ok("IkiWiki"); } @@ -135,7 +135,7 @@ is_deeply(\@{$links{'index.fr'}}, ['translatable.fr', 'nontranslatable'], "$msgp is_deeply(\@{$links{'translatable'}}, ['nontranslatable'], "$msgprefix translatable"); is_deeply(\@{$links{'translatable.es'}}, ['nontranslatable'], "$msgprefix translatable.es"); is_deeply(\@{$links{'translatable.fr'}}, ['nontranslatable'], "$msgprefix translatable.fr"); -is_deeply(\@{$links{'nontranslatable'}}, ['/', 'translatable', 'translatable.fr', 'translatable.es'], "$msgprefix nontranslatable"); +is_deeply([sort @{$links{'nontranslatable'}}], [sort('/', 'translatable', 'translatable.fr', 'translatable.es')], "$msgprefix nontranslatable"); $config{po_link_to}='current'; $msgprefix="links (po_link_to=current)"; @@ -146,7 +146,7 @@ is_deeply(\@{$links{'index.fr'}}, [ (map bestlink('index.fr', $_), ('translatabl is_deeply(\@{$links{'translatable'}}, [bestlink('translatable', 'nontranslatable')], "$msgprefix translatable"); is_deeply(\@{$links{'translatable.es'}}, ['nontranslatable'], "$msgprefix translatable.es"); is_deeply(\@{$links{'translatable.fr'}}, ['nontranslatable'], "$msgprefix translatable.fr"); -is_deeply(\@{$links{'nontranslatable'}}, ['/', 'translatable', 'translatable.fr', 'translatable.es'], "$msgprefix nontranslatable"); +is_deeply([sort @{$links{'nontranslatable'}}], [sort('/', 'translatable', 'translatable.fr', 'translatable.es')], "$msgprefix nontranslatable"); ### targetpage $config{usedirs}=0; @@ -241,3 +241,10 @@ ok(! IkiWiki::Plugin::po::istranslatedto('nontranslatable', 'es')); ok(! IkiWiki::Plugin::po::istranslatedto('nontranslatable', 'cz')); ok(! IkiWiki::Plugin::po::istranslatedto('test1.es', 'fr')); ok(! IkiWiki::Plugin::po::istranslatedto('test1.fr', 'es')); + +### islanguagecode +ok(IkiWiki::Plugin::po::islanguagecode('en')); +ok(IkiWiki::Plugin::po::islanguagecode('es')); +ok(IkiWiki::Plugin::po::islanguagecode('arn')); +ok(! IkiWiki::Plugin::po::islanguagecode('es_')); +ok(! IkiWiki::Plugin::po::islanguagecode('_en'));