diff options
author | Simon McVittie <smcv@debian.org> | 2011-01-22 22:22:48 +0000 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2011-01-22 22:22:48 +0000 |
commit | e15e6cce6ca9eed6d0eabe6b9f100b713dcf2b59 (patch) | |
tree | 09d04c2137621d61c6007dbb2716a604a17b1254 | |
parent | 394e8fdb5e787c42ef2a85aa08d5123cf6e87086 (diff) | |
download | ikiwiki-e15e6cce6ca9eed6d0eabe6b9f100b713dcf2b59.tar ikiwiki-e15e6cce6ca9eed6d0eabe6b9f100b713dcf2b59.tar.gz |
autoindex test: check that an internal page doesn't cause indexing
-rwxr-xr-x | t/autoindex.t | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/t/autoindex.t b/t/autoindex.t index 9bef2415a..f56a35269 100755 --- a/t/autoindex.t +++ b/t/autoindex.t @@ -3,10 +3,11 @@ package IkiWiki; use warnings; use strict; -use Test::More tests => 17; +use Test::More tests => 20; BEGIN { use_ok("IkiWiki"); } BEGIN { use_ok("IkiWiki::Render"); } +BEGIN { use_ok("IkiWiki::Plugin::aggregate"); } BEGIN { use_ok("IkiWiki::Plugin::autoindex"); } BEGIN { use_ok("IkiWiki::Plugin::html"); } BEGIN { use_ok("IkiWiki::Plugin::mdwn"); } @@ -45,6 +46,12 @@ foreach my $page (qw(tags/numbers deleted/bar reinstated reinstated/foo gone/bar writefile("$page.html", "t/tmp", "your ad here"); } +# a directory containing only an internal page shouldn't be indexed +$pagesources{"has_internal/internal"} = "has_internal/internal._aggregated"; +$pagemtime{"has_internal/internal"} = 123456789; +$pagectime{"has_internal/internal"} = 123456789; +writefile("has_internal/internal._aggregated", "t/tmp", "this page is internal"); + # "gone" disappeared just before this refresh pass so it still has a mtime $pagemtime{gone} = $pagectime{gone} = 1000000; @@ -62,6 +69,10 @@ ok(! -f "t/tmp/gone.mdwn"); ok(! exists $wikistate{autoindex}{deleted}{expunged}); ok(! -f "t/tmp/expunged.mdwn"); +# a directory containing only an internal page shouldn't be indexed +ok(! exists $wikistate{autoindex}{deleted}{has_internal}); +ok(! -f "t/tmp/has_internal.mdwn"); + # this page was re-created, so it drops off the radar ok(! exists $wikistate{autoindex}{deleted}{reinstated}); ok(! -f "t/tmp/reinstated.mdwn"); |