From bcf3f9091a945467a7a68b5b828915e65f0ea139 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 21 May 2009 12:44:21 -0400 Subject: add test case for multiline pagespec --- t/pagespec_match.t | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 't') 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"); -- cgit v1.2.3 From e92c6722ddd559060514097ac1790c9edc2ee996 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 22 May 2009 13:27:23 -0400 Subject: stop using perl -T here See bug #411786. Perl's random corruption of the taint flag is even effecting the untainting of source filenames now (which AFAICS, is a proper untaint and always worked before..), and that makes using ikiwiki in perl taint mode not work at all. --- t/basewiki_brokenlinks.t | 2 +- t/permalink.t | 2 +- t/syntax.t | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 't') diff --git a/t/basewiki_brokenlinks.t b/t/basewiki_brokenlinks.t index ac04f800f..479c71a93 100755 --- a/t/basewiki_brokenlinks.t +++ b/t/basewiki_brokenlinks.t @@ -8,7 +8,7 @@ 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 ". 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' t/tmp/out/index.rss`); diff --git a/t/syntax.t b/t/syntax.t index d09d17f7f..05d955f33 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); -- cgit v1.2.3 From fd7db49f941eab604fcabdf78b3c36c743005d34 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 25 May 2009 12:40:40 -0400 Subject: Fix test suite to not rely on an installed copy of ikiwiki after underlaydir change. Closes: #530502 --- t/basewiki_brokenlinks.t | 1 + 1 file changed, 1 insertion(+) (limited to 't') diff --git a/t/basewiki_brokenlinks.t b/t/basewiki_brokenlinks.t index 479c71a93..2871b1dd2 100755 --- a/t/basewiki_brokenlinks.t +++ b/t/basewiki_brokenlinks.t @@ -14,6 +14,7 @@ foreach my $plugin ("", "listdirectives") { "-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)); -- cgit v1.2.3 From 763f4b91da9bb8701b3000a1290a1d5f22850551 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 5 Jun 2009 16:10:08 -0400 Subject: add test case for unterminated """ string A directive that contains an unterminated """ string should not cause each word of the string to be treated as a bare word. Instead, the directive should fail to parse. There are two tests. One just checks that a complete directive containing such a string fails to parse. The other checks for a case where a directive ends with a very long unterminated """ string, and the directive is itself not closed. While this test won't fail, it does trigger a nasty perl warning. --- t/preprocess.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 't') 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"; -- cgit v1.2.3