X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/aed42eb34ac50912a995dee41ce7dd6e3c3b7f81..37b8822762ba8a2096adae18997e406023deddf3:/t/po.t diff --git a/t/po.t b/t/po.t index 752fc95c6..827e7c7a5 100755 --- a/t/po.t +++ b/t/po.t @@ -67,32 +67,21 @@ foreach my $page (keys %pagesources) { ### istranslatable/istranslation # we run these tests twice because memoization attempts made them # succeed once every two tries... +foreach (1, 2) { ok(IkiWiki::Plugin::po::istranslatable('index'), "index is translatable"); -ok(IkiWiki::Plugin::po::istranslatable('index'), "index is translatable"); -ok(IkiWiki::Plugin::po::istranslatable('/index'), "/index is translatable"); ok(IkiWiki::Plugin::po::istranslatable('/index'), "/index is translatable"); ok(! IkiWiki::Plugin::po::istranslatable('index.fr'), "index.fr is not translatable"); -ok(! IkiWiki::Plugin::po::istranslatable('index.fr'), "index.fr is not translatable"); -ok(! IkiWiki::Plugin::po::istranslatable('index.es'), "index.es is not translatable"); ok(! IkiWiki::Plugin::po::istranslatable('index.es'), "index.es is not translatable"); ok(! IkiWiki::Plugin::po::istranslatable('/index.fr'), "/index.fr is not translatable"); -ok(! IkiWiki::Plugin::po::istranslatable('/index.fr'), "/index.fr is not translatable"); -ok(! IkiWiki::Plugin::po::istranslation('index'), "index is not a translation"); ok(! IkiWiki::Plugin::po::istranslation('index'), "index is not a translation"); ok(IkiWiki::Plugin::po::istranslation('index.fr'), "index.fr is a translation"); -ok(IkiWiki::Plugin::po::istranslation('index.fr'), "index.fr is a translation"); ok(IkiWiki::Plugin::po::istranslation('index.es'), "index.es is a translation"); -ok(IkiWiki::Plugin::po::istranslation('index.es'), "index.es is a translation"); -ok(IkiWiki::Plugin::po::istranslation('/index.fr'), "/index.fr is a translation"); ok(IkiWiki::Plugin::po::istranslation('/index.fr'), "/index.fr is a translation"); ok(IkiWiki::Plugin::po::istranslatable('test2'), "test2 is translatable"); -ok(IkiWiki::Plugin::po::istranslatable('test2'), "test2 is translatable"); -ok(! IkiWiki::Plugin::po::istranslation('test2'), "test2 is not a translation"); ok(! IkiWiki::Plugin::po::istranslation('test2'), "test2 is not a translation"); ok(! IkiWiki::Plugin::po::istranslatable('test3'), "test3 is not translatable"); -ok(! IkiWiki::Plugin::po::istranslatable('test3'), "test3 is not translatable"); -ok(! IkiWiki::Plugin::po::istranslation('test3'), "test3 is not a translation"); ok(! IkiWiki::Plugin::po::istranslation('test3'), "test3 is not a translation"); +} ### links require IkiWiki::Render; @@ -154,13 +143,13 @@ is(targetpage('test3.es', 'html'), 'test3.es/index.html', "$msgprefix test3.es ( $config{po_link_to}='current'; $msgprefix="urlto (po_link_to=current)"; is(urlto('', 'index'), './index.en.html', "$msgprefix index -> ''"); -is(urlto('', 'nontranslatable'), './../index.en.html', "$msgprefix nontranslatable -> ''"); -is(urlto('', 'translatable.fr'), './../index.fr.html', "$msgprefix translatable.fr -> ''"); +is(urlto('', 'nontranslatable'), '../index.en.html', "$msgprefix nontranslatable -> ''"); +is(urlto('', 'translatable.fr'), '../index.fr.html', "$msgprefix translatable.fr -> ''"); $config{po_link_to}='negotiated'; $msgprefix="urlto (po_link_to=negotiated)"; is(urlto('', 'index'), './', "$msgprefix index -> ''"); -is(urlto('', 'nontranslatable'), './../', "$msgprefix nontranslatable -> ''"); -is(urlto('', 'translatable.fr'), './../', "$msgprefix translatable.fr -> ''"); +is(urlto('', 'nontranslatable'), '../', "$msgprefix nontranslatable -> ''"); +is(urlto('', 'translatable.fr'), '../', "$msgprefix translatable.fr -> ''"); ### bestlink $config{po_link_to}='current';