summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/basewiki_brokenlinks.t3
-rwxr-xr-xt/pagespec_match.t11
-rwxr-xr-xt/permalink.t2
-rwxr-xr-xt/preprocess.t7
-rwxr-xr-xt/syntax.t2
5 files changed, 20 insertions, 5 deletions
diff --git a/t/basewiki_brokenlinks.t b/t/basewiki_brokenlinks.t
index ac04f800f..2871b1dd2 100755
--- a/t/basewiki_brokenlinks.t
+++ b/t/basewiki_brokenlinks.t
@@ -8,12 +8,13 @@ ok(! system("make -s ikiwiki.out"));
ok(! system("make extra_install DESTDIR=`pwd`/t/tmp/install PREFIX=/usr >/dev/null"));
foreach my $plugin ("", "listdirectives") {
- ok(! system("LC_ALL=C perl -T -I. ./ikiwiki.out -rebuild -plugin brokenlinks ".
+ ok(! system("LC_ALL=C perl -I. ./ikiwiki.out -rebuild -plugin brokenlinks ".
# always enabled because pages link to it conditionally,
# which brokenlinks cannot handle properly
"-plugin smiley ".
($plugin ? "-plugin $plugin " : "").
"-underlaydir=t/tmp/install/usr/share/ikiwiki/basewiki ".
+ "-set underlaydirbase=t/tmp/install/usr/share/ikiwiki ".
"-templatedir=templates t/basewiki_brokenlinks t/tmp/out"));
my $result=`grep 'no broken links' t/tmp/out/index.html`;
ok(length($result));
diff --git a/t/pagespec_match.t b/t/pagespec_match.t
index 4cf6fa1ff..64408f489 100755
--- a/t/pagespec_match.t
+++ b/t/pagespec_match.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use warnings;
use strict;
-use Test::More tests => 53;
+use Test::More tests => 54;
BEGIN { use_ok("IkiWiki"); }
@@ -20,6 +20,15 @@ ok(! pagespec_match("foo", "* and !foo"));
ok(! pagespec_match("foo", "foo and !foo"));
ok(! pagespec_match("foo.png", "* and !*.*"));
ok(pagespec_match("foo", "(bar or ((meep and foo) or (baz or foo) or beep))"));
+ok(pagespec_match("foo", "(
+ bar
+ or (
+ (meep and foo)
+ or
+ (baz or foo)
+ or beep
+ )
+)"), "multiline complex pagespec");
ok(! pagespec_match("a/foo", "foo", location => "a/b"), "nonrelative fail");
ok(! pagespec_match("foo", "./*", location => "a/b"), "relative fail");
ok(pagespec_match("a/foo", "./*", location => "a/b"), "relative");
diff --git a/t/permalink.t b/t/permalink.t
index 9b44cd72e..c326e8d27 100755
--- a/t/permalink.t
+++ b/t/permalink.t
@@ -5,7 +5,7 @@ use Test::More 'no_plan';
ok(! system("mkdir t/tmp"));
ok(! system("make -s ikiwiki.out"));
-ok(! system("LC_ALL=C perl -T -I. ./ikiwiki.out -plugin inline -url=http://example.com -cgiurl=http://example.com/ikiwiki.cgi -rss -atom -underlaydir=underlays/basewiki -templatedir=templates t/tinyblog t/tmp/out"));
+ok(! system("LC_ALL=C perl -I. ./ikiwiki.out -plugin inline -url=http://example.com -cgiurl=http://example.com/ikiwiki.cgi -rss -atom -underlaydir=underlays/basewiki -templatedir=templates t/tinyblog t/tmp/out"));
# This guid should never, ever change, for any reason whatsoever!
my $guid="http://example.com/post/";
ok(length `grep '<guid>$guid</guid>' t/tmp/out/index.rss`);
diff --git a/t/preprocess.t b/t/preprocess.t
index 7699f56ba..e5026ed64 100755
--- a/t/preprocess.t
+++ b/t/preprocess.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use warnings;
use strict;
-use Test::More tests => 19;
+use Test::More tests => 21;
BEGIN { use_ok("IkiWiki"); }
@@ -51,6 +51,11 @@ is(IkiWiki::preprocess("foo", "foo", '[[foo a="""'.$multiline.'""" b="foo"]]', 0
"foo(a => $multiline, b => foo)");
is(IkiWiki::preprocess("foo", "foo", '[[foo a="""'."\n".$multiline."\n".'""" b="foo"]]', 0, 0),
"foo(a => $multiline, b => foo)", "leading/trailing newline stripped");
+my $long='[[foo a="""'.("a" x 100000).'';
+is(IkiWiki::preprocess("foo", "foo", $long, 0, 0), $long,
+ "unterminated triple-quoted string inside unterminated directive(should not warn about over-recursion)");
+is(IkiWiki::preprocess("foo", "foo", $long."]]", 0, 0), $long."]]",
+ "unterminated triple-quoted string is not treated as a bare word");
TODO: {
local $TODO = "nested strings not yet implemented";
diff --git a/t/syntax.t b/t/syntax.t
index 8c96d1d84..a3760a2b2 100755
--- a/t/syntax.t
+++ b/t/syntax.t
@@ -12,7 +12,7 @@ push @libs, 'IkiWiki/Plugin/skeleton.pm.example';
plan(tests => (@progs + @libs));
foreach my $file (@progs) {
- ok(system("perl -T -c $file >/dev/null 2>&1") eq 0, $file);
+ ok(system("perl -c $file >/dev/null 2>&1") eq 0, $file);
}
foreach my $file (@libs) {
ok(system("perl -c $file >/dev/null 2>&1") eq 0, $file);