aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2014-09-14 15:14:42 +0100
committerSimon McVittie <smcv@debian.org>2014-09-14 15:14:42 +0100
commit43367c5e30130601dd526b017b29fc05a4c940e6 (patch)
tree97efb30caab95a5cd9fe35f743662e10e3753670
parentc6a237d08a29bae77f8ee7aead1f05b4368a74d5 (diff)
downloadikiwiki-43367c5e30130601dd526b017b29fc05a4c940e6.tar
ikiwiki-43367c5e30130601dd526b017b29fc05a4c940e6.tar.gz
extend regression test for inline to cover inlining, show, reverse
-rwxr-xr-xt/inline.t19
1 files changed, 14 insertions, 5 deletions
diff --git a/t/inline.t b/t/inline.t
index b34cd27dc..726227b8f 100755
--- a/t/inline.t
+++ b/t/inline.t
@@ -20,16 +20,17 @@ sub write_old_file {
write_old_file("protagonists.mdwn",
'[[!inline pages="protagonists/*" rootpage="protagonists/new"]]');
write_old_file("friends.mdwn",
- '[[!inline pages="friends/*" postform=yes]]');
+ '[[!inline pages="friends/*" postform=yes sort=title show=2]]');
write_old_file("antagonists.mdwn",
'[[!inline pages="antagonists/*"]]');
write_old_file("enemies.mdwn",
- '[[!inline pages="enemies/*" postform=no rootpage=enemies]]');
+ '[[!inline pages="enemies/*" postform=no rootpage=enemies sort=title reverse=yes show=2]]');
foreach my $page (qw(protagonists/shepard protagonists/link
antagonists/saren antagonists/ganondorf
- friends/liara friends/midna
- enemies/benezia enemies/zant)) {
- write_old_file("$page.mdwn", "this page is *$page*");
+ friends/garrus friends/liara friends/midna friends/telma
+ enemies/benezia enemies/geth enemies/rachni
+ enemies/zant)) {
+ write_old_file("$page.mdwn", "this page is {$page}");
}
ok(! system("make -s ikiwiki.out"));
@@ -49,11 +50,19 @@ $blob = readfile("t/tmp/out/friends.html");
like($blob, qr{Add a new post}, 'postform=yes forces postform');
like($blob, qr{<input type="hidden" name="from" value="friends"},
'implicit rootpage is /friends');
+like($blob, qr[this page is {friends/garrus}.*this page is {friends/liara}]s,
+ 'first two pages in desired sort order are present');
+unlike($blob, qr{friends/(?:midna|telma)},
+ 'pages excluded by show should not be present');
$blob = readfile("t/tmp/out/antagonists.html");
unlike($blob, qr{Add a new post}, 'default is no postform');
$blob = readfile("t/tmp/out/enemies.html");
unlike($blob, qr{Add a new post}, 'postform=no forces no postform');
+like($blob, qr[this page is {enemies/zant}.*this page is {enemies/rachni}]s,
+ 'first two pages in reversed sort order are present');
+unlike($blob, qr{enemies/(?:benezia|geth)},
+ 'pages excluded by show should not be present');
done_testing;