X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/2a60cda1729ead6dd2f13fc40ef1dccec5b30d92..c9076b35cd6d3eefb46ec47f9438b79d05fbba15:/t/tag.t?ds=sidebyside diff --git a/t/tag.t b/t/tag.t index f4aac765f..cc0a30cad 100755 --- a/t/tag.t +++ b/t/tag.t @@ -3,7 +3,7 @@ package IkiWiki; use warnings; use strict; -use Test::More tests => 22; +use Test::More tests => 24; BEGIN { use_ok("IkiWiki"); } BEGIN { use_ok("IkiWiki::Render"); } @@ -12,7 +12,6 @@ BEGIN { use_ok("IkiWiki::Plugin::tag"); } ok(! system("rm -rf t/tmp; mkdir t/tmp")); -$config{verbose} = 1; $config{srcdir} = 't/tmp'; $config{underlaydir} = 't/tmp'; $config{templatedir} = 'templates'; @@ -22,7 +21,7 @@ $config{wiki_file_chars} = "-[:alnum:]+/.:_"; $config{userdir} = "users"; $config{tagbase} = "tags"; $config{tag_autocreate} = 1; -$config{tag_autocreate_commit} = 1; +$config{tag_autocreate_commit} = 0; $config{default_pageext} = "mdwn"; $config{wiki_file_prune_regexps} = [qr/^\./]; $config{underlaydirbase} = '.'; @@ -64,21 +63,26 @@ is_deeply([sort keys %autofiles], [qw(tags/lucky.mdwn tags/numbers.mdwn tags/pri 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/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']); + + +# cleanup +ok(! system("rm -rf t/tmp")); 1;