]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - t/tag.t
mdwn: Added nodiscount setting, which can be used to avoid using the markdown discoun...
[git.ikiwiki.info.git] / t / tag.t
diff --git a/t/tag.t b/t/tag.t
index 5b0d9c824b6d9efc27faf2ebf0d559644a352ef5..cc0a30cadf481c6d0d9be8ad431e67d05f84790e 100755 (executable)
--- a/t/tag.t
+++ b/t/tag.t
@@ -3,7 +3,7 @@ package IkiWiki;
 
 use warnings;
 use strict;
 
 use warnings;
 use strict;
-use Test::More tests => 22;
+use Test::More tests => 24;
 
 BEGIN { use_ok("IkiWiki"); }
 BEGIN { use_ok("IkiWiki::Render"); }
 
 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"));
 
 
 ok(! system("rm -rf t/tmp; mkdir t/tmp"));
 
-$config{verbose} = 1;
 $config{srcdir} = 't/tmp';
 $config{underlaydir} = 't/tmp';
 $config{templatedir} = 'templates';
 $config{srcdir} = 't/tmp';
 $config{underlaydir} = 't/tmp';
 $config{templatedir} = 'templates';
@@ -22,6 +21,7 @@ $config{wiki_file_chars} = "-[:alnum:]+/.:_";
 $config{userdir} = "users";
 $config{tagbase} = "tags";
 $config{tag_autocreate} = 1;
 $config{userdir} = "users";
 $config{tagbase} = "tags";
 $config{tag_autocreate} = 1;
+$config{tag_autocreate_commit} = 0;
 $config{default_pageext} = "mdwn";
 $config{wiki_file_prune_regexps} = [qr/^\./];
 $config{underlaydirbase} = '.';
 $config{default_pageext} = "mdwn";
 $config{wiki_file_prune_regexps} = [qr/^\./];
 $config{underlaydirbase} = '.';
@@ -58,13 +58,15 @@ IkiWiki::Plugin::tag::preprocess_tag(page => "seven", numbers => undef, primes =
 is($autofiles{"tags/lucky.mdwn"}{plugin}, "tag");
 is($autofiles{"tags/numbers.mdwn"}{plugin}, "tag");
 is($autofiles{"tags/primes.mdwn"}{plugin}, "tag");
 is($autofiles{"tags/lucky.mdwn"}{plugin}, "tag");
 is($autofiles{"tags/numbers.mdwn"}{plugin}, "tag");
 is($autofiles{"tags/primes.mdwn"}{plugin}, "tag");
+is_deeply([sort keys %autofiles], [qw(tags/lucky.mdwn tags/numbers.mdwn tags/primes.mdwn)]);
 
 ok(!-e "t/tmp/tags/lucky.mdwn");
 my (%pages, @del);
 IkiWiki::gen_autofile("tags/lucky.mdwn", \%pages, \@del);
 
 ok(!-e "t/tmp/tags/lucky.mdwn");
 my (%pages, @del);
 IkiWiki::gen_autofile("tags/lucky.mdwn", \%pages, \@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, []);
 is_deeply(\%pages, {"t/tmp/tags/lucky" => 1});
 is_deeply(\@del, []);
-ok(-s "t/tmp/tags/lucky.mdwn");
 
 # generating an autofile that already exists does nothing
 %pages = @del = ();
 
 # generating an autofile that already exists does nothing
 %pages = @del = ();