X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/72c3b81efb1079f8db070ac89e97e9b7bcedd61b..dc126c54264612607633f95ee7104c4c3653a6ca:/t/inline.t diff --git a/t/inline.t b/t/inline.t index 859e1701a..8c0f1c35a 100755 --- a/t/inline.t +++ b/t/inline.t @@ -46,6 +46,9 @@ write_old_file("antagonists.mdwn", # using old spelling of "limit" ("show") to verify backwards compat write_old_file("enemies.mdwn", '[[!inline pages="enemies/*" postform=no rootpage=enemies sort=title reverse=yes show=2]]'); +# to test correct processing of ../ +write_old_file("blah/blah/enemies.mdwn", + '[[!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/garrus friends/liara friends/midna friends/telma @@ -53,6 +56,9 @@ foreach my $page (qw(protagonists/shepard protagonists/link enemies/zant)) { write_old_file("$page.mdwn", "this page is {$page}"); } +# test cross-linking between pages as rendered in RSS +write_old_file("enemies/zant.mdwn", "this page is {enemies/zant}\n\n". + "Zant hates [[friends/Midna]]."); ok(! system(@command)); ok(! system(@command, "--refresh")); @@ -81,4 +87,18 @@ like($blob, qr[this page is \{enemies/zant}.*this page is \{enemies/rachni}]s, unlike($blob, qr{enemies/(?:benezia|geth)}, 'pages excluded by show should not be present'); +$blob = readfile("t/tmp/out/enemies.rss"); +like($blob, qr[this page is \{enemies/zant}.*this page is \{enemies/rachni}]s, + 'first two pages in reversed sort order are present'); +like($blob, + qr[Zant hates <a href=(?:['"]|")http://example\.com/friends/midna.html(?:['"]|")>Midna</a>]s, + 'link is correctly relative'); + +$blob = readfile("t/tmp/out/blah/blah/enemies.rss"); +like($blob, qr[this page is \{enemies/zant}.*this page is \{enemies/rachni}]s, + 'first two pages in reversed sort order are present'); +like($blob, + qr[Zant hates <a href=(?:['"]|")http://example\.com/friends/midna.html(?:['"]|")>Midna</a>]s, + 'link is correctly relative'); + done_testing;