#!/usr/bin/perl
# -*- cperl-indent-level: 8; -*-
-# Testcases for the Ikiwiki pedigree plugin.
+# Testcases for the Ikiwiki parentlinks plugin.
use warnings;
use strict;
-use Test::More 'no_plan';
+use Test::More;
my %expected;
%config=IkiWiki::defaultconfig();
$config{srcdir}=$config{destdir}="/dev/null";
$config{underlaydir}="underlays/basewiki";
-$config{templatedir}="t/pedigree/templates";
+$config{templatedir}="t/parentlinks/templates";
IkiWiki::loadplugins();
IkiWiki::checkconfig();
-ok(IkiWiki::loadplugin("pedigree"), "pedigree plugin loaded");
# Test data
-$expected{'pedigree'} =
+$expected{'parentlinks'} =
{
- "" => [],
"ikiwiki" => [],
"ikiwiki/pagespec" =>
[ {depth => 0, height => 2, },
my $template;
my %params;
- ok($template=template('pedigree.tmpl'), "template created");
+ ok($template=template('parentlinks.tmpl'), "template created");
ok($params{template}=$template, "params populated");
while ((my $page, my $exp) = each %{$expected}) {
# manually run the plugin hook
$params{page}=$page;
$template->clear_params();
- IkiWiki::Plugin::pedigree::pagetemplate(%params);
+ IkiWiki::Plugin::parentlinks::pagetemplate(%params);
my $res=$template->param($loop);
is(scalar(@$res), $pagedepth, "$msgprefix: path length");
}
# Main
-test_loop('pedigree', $expected{'pedigree'});
+test_loop('parentlinks', $expected{'parentlinks'});
+
+done_testing();