]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
Merge remote branch 'intrigeri/po'
authorJoey Hess <joey@kitenet.net>
Sat, 24 Jul 2010 09:22:33 +0000 (05:22 -0400)
committerJoey Hess <joey@kitenet.net>
Sat, 24 Jul 2010 09:22:33 +0000 (05:22 -0400)
1  2 
t/po.t

diff --combined t/po.t
index 0155b5303789433b73ee2edfc20a46845c5e279d,a52611935deb2111c9daecf5b812b9ba3ee449c0..444743cac5dff6451402132436f794e0fc19bd93
--- 1/t/po.t
--- 2/t/po.t
+++ b/t/po.t
@@@ -17,7 -17,7 +17,7 @@@ BEGIN 
        }
  }
  
- use Test::More tests => 65;
+ use Test::More tests => 68;
  
  BEGIN { use_ok("IkiWiki"); }
  
@@@ -42,8 -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';
@@@ -61,7 -61,7 +61,7 @@@ $pagesources{'translatable.fr'}='transl
  $pagesources{'translatable.es'}='translatable.es.po';
  $pagesources{'nontranslatable'}='nontranslatable.mdwn';
  foreach my $page (keys %pagesources) {
 -    $IkiWiki::pagecase{lc $page}=$page;
 +      $IkiWiki::pagecase{lc $page}=$page;
  }
  
  ### populate srcdir
@@@ -91,6 -91,13 +91,13 @@@ ok(! IkiWiki::Plugin::po::istranslatabl
  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;
  
@@@ -111,8 -118,8 +118,8 @@@ $config{po_link_to}='negotiated'
  $msgprefix="links (po_link_to=negotiated)";
  refresh_n_scan('index.mdwn', 'translatable.mdwn', 'nontranslatable.mdwn');
  is_deeply(\@{$links{'index'}}, ['translatable', 'nontranslatable'], "$msgprefix index");
- is_deeply(\@{$links{'index.es'}}, ['translatable.es', 'nontranslatable'], "$msgprefix index.es");
- is_deeply(\@{$links{'index.fr'}}, ['translatable.fr', 'nontranslatable'], "$msgprefix index.fr");
+ is_deeply(\@{$links{'index.es'}}, ['translatable.es', 'nontranslatable', 'SandBox', 'ikiwiki'], "$msgprefix index.es");
+ is_deeply(\@{$links{'index.fr'}}, ['translatable.fr', 'nontranslatable', 'SandBox', 'ikiwiki'], "$msgprefix index.fr");
  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");
@@@ -122,8 -129,8 +129,8 @@@ $config{po_link_to}='current'
  $msgprefix="links (po_link_to=current)";
  refresh_n_scan('index.mdwn', 'translatable.mdwn', 'nontranslatable.mdwn');
  is_deeply(\@{$links{'index'}}, ['translatable', 'nontranslatable'], "$msgprefix index");
- is_deeply(\@{$links{'index.es'}}, [ map bestlink('index.es', $_), ('translatable.es', 'nontranslatable')], "$msgprefix index.es");
- is_deeply(\@{$links{'index.fr'}}, [ map bestlink('index.fr', $_), ('translatable.fr', 'nontranslatable')], "$msgprefix index.fr");
+ is_deeply(\@{$links{'index.es'}}, [ (map bestlink('index.es', $_), ('translatable.es', 'nontranslatable')), 'SandBox', 'ikiwiki'], "$msgprefix index.es");
+ is_deeply(\@{$links{'index.fr'}}, [ (map bestlink('index.fr', $_), ('translatable.fr', 'nontranslatable')), 'SandBox', 'ikiwiki'], "$msgprefix index.fr");
  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");