]> sipb.mit.edu Git - ikiwiki.git/blobdiff - t/po.t
Add forum query about using an inverted banned_user list.
[ikiwiki.git] / t / po.t
diff --git a/t/po.t b/t/po.t
index da0bd68a7d89e6177ddc811e503444d75c59c264..0db56edc9efae236deeaf8b7348b4bc9e65bbcf9 100755 (executable)
--- 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'));