4 use Test::More tests => 25;
6 BEGIN { use_ok("IkiWiki"); }
8 %config=IkiWiki::defaultconfig();
9 $config{srcdir}=$config{destdir}="/dev/null";
10 IkiWiki::checkconfig();
13 my ($before, $after) = @_;
15 $IkiWiki::SortSpec::a = $before;
16 $IkiWiki::SortSpec::b = $after;
17 my $r = IkiWiki::SortSpec::cmp_path();
19 if ($before eq $after) {
26 $IkiWiki::SortSpec::a = $after;
27 $IkiWiki::SortSpec::b = $before;
28 $r = IkiWiki::SortSpec::cmp_path();
30 if ($before eq $after) {
37 is_deeply([IkiWiki::SortSpec::sort_pages(\&IkiWiki::SortSpec::cmp_path, $before, $after)],
39 is_deeply([IkiWiki::SortSpec::sort_pages(\&IkiWiki::SortSpec::cmp_path, $after, $before)],
43 test("a/b/c", "a/b/c");