use warnings;
use strict;
-use Test::More tests => 23;
+use Test::More;
BEGIN { use_ok("IkiWiki"); }
BEGIN { use_ok("IkiWiki::Render"); }
ok(! system("rm -rf t/tmp; mkdir t/tmp"));
-$config{verbose} = 1;
$config{srcdir} = 't/tmp';
$config{underlaydir} = 't/tmp';
$config{templatedir} = 'templates';
ok(!-e "t/tmp/tags/lucky.mdwn");
my (%pages, @del);
IkiWiki::gen_autofile("tags/lucky.mdwn", \%pages, \@del);
-is_deeply(\%pages, {"t/tmp/tags/lucky" => 1}) || diag explain \%pages;
-is_deeply(\@del, []) || diag explain \@del;
ok(! -s "t/tmp/tags/lucky.mdwn");
ok(-s "t/tmp/.ikiwiki/transient/tags/lucky.mdwn");
+is_deeply(\%pages, {"t/tmp/tags/lucky" => 1});
+is_deeply(\@del, []);
# generating an autofile that already exists does nothing
%pages = @del = ();
IkiWiki::gen_autofile("tags/numbers.mdwn", \%pages, \@del);
-is_deeply(\%pages, {}) || diag explain \%pages;
-is_deeply(\@del, []) || diag explain \@del;
+is_deeply(\%pages, {});
+is_deeply(\@del, []);
# generating an autofile that we just deleted does nothing
%pages = ();
@del = ('tags/primes.mdwn');
IkiWiki::gen_autofile("tags/primes.mdwn", \%pages, \@del);
-is_deeply(\%pages, {}) || diag explain \%pages;
-is_deeply(\@del, ['tags/primes.mdwn']) || diag explain \@del;
+is_deeply(\%pages, {});
+is_deeply(\@del, ['tags/primes.mdwn']);
-1;
+done_testing;