]> scripts.mit.edu Git - www/ikiwiki.git/blobdiff - t/po.t
Added tests for po::pofiles.
[www/ikiwiki.git] / t / po.t
diff --git a/t/po.t b/t/po.t
index b6885a37e0983fb75340ec78e13934fb4fc93e53..de5ace3a0dd6f0016275296dc65d08a56388dc2c 100755 (executable)
--- a/t/po.t
+++ b/t/po.t
@@ -17,7 +17,7 @@ BEGIN {
        }
 }
 
-use Test::More tests => 65;
+use Test::More tests => 68;
 
 BEGIN { use_ok("IkiWiki"); }
 
@@ -42,8 +42,8 @@ $config{po_slave_languages} = {
 $config{po_translatable_pages}='index or test1 or test2 or translatable';
 $config{po_link_to}='negotiated';
 IkiWiki::loadplugins();
-IkiWiki::checkconfig();
 ok(IkiWiki::loadplugin('po'), "po plugin loaded");
+IkiWiki::checkconfig();
 
 ### seed %pagesources and %pagecase
 $pagesources{'index'}='index.mdwn';
@@ -91,6 +91,13 @@ ok(! IkiWiki::Plugin::po::istranslatable('test3'), "test3 is not translatable");
 ok(! IkiWiki::Plugin::po::istranslation('test3'), "test3 is not a translation");
 }
 
+### pofiles
+
+my @pofiles = IkiWiki::Plugin::po::pofiles(srcfile("index.mdwn"));
+ok( @pofiles, "pofiles is defined");
+ok( @pofiles == 2, "pofiles has correct size");
+is_deeply(\@pofiles, ["$config{srcdir}/index.es.po", "$config{srcdir}/index.fr.po"], "pofiles content is correct");
+
 ### links
 require IkiWiki::Render;