aboutsummaryrefslogtreecommitdiff
path: root/t/preprocess.t
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2010-02-26 11:49:51 -0500
committerJoey Hess <joey@gnu.kitenet.net>2010-02-26 11:49:51 -0500
commitb3c3c42b269c102123dcd80979cb9c49ce13bca7 (patch)
treedcab5238b0fbcbb98e5b63b6f3b22f1dc6ae8fb6 /t/preprocess.t
parent068e47aa459028c260880ed5f27da2044cb79998 (diff)
downloadikiwiki-b3c3c42b269c102123dcd80979cb9c49ce13bca7.tar
ikiwiki-b3c3c42b269c102123dcd80979cb9c49ce13bca7.tar.gz
Loosen regexp, to allow empty quoted parameters in directives.
Diffstat (limited to 't/preprocess.t')
-rwxr-xr-xt/preprocess.t12
1 files changed, 11 insertions, 1 deletions
diff --git a/t/preprocess.t b/t/preprocess.t
index e5026ed64..7bb9878d0 100755
--- a/t/preprocess.t
+++ b/t/preprocess.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use warnings;
use strict;
-use Test::More tests => 21;
+use Test::More tests => 31;
BEGIN { use_ok("IkiWiki"); }
@@ -26,6 +26,16 @@ is(IkiWiki::preprocess("foo", "foo", "[[foo ]]", 0, 0), "foo()", "simple");
is(IkiWiki::preprocess("foo", "foo", "[[!foo ]]", 0, 0), "foo()", "prefixed");
is(IkiWiki::preprocess("foo", "foo", "[[!foo]]", 0, 0), "[[!foo]]", "prefixed, no space");
is(IkiWiki::preprocess("foo", "foo", "[[foo a=1]]", 0, 0), "foo(a => 1)");
+is(IkiWiki::preprocess("foo", "foo", q{[[foo a="1"]]}, 0, 0), "foo(a => 1)");
+is(IkiWiki::preprocess("foo", "foo", q{[[foo a="""1"""]]}, 0, 0), "foo(a => 1)");
+is(IkiWiki::preprocess("foo", "foo", q{[[foo a=""]]}, 0, 0), "foo(a)");
+is(IkiWiki::preprocess("foo", "foo", q{[[foo a="" b="1"]]}, 0, 0), "foo(a, b => 1)");
+is(IkiWiki::preprocess("foo", "foo", q{[[foo a=""""""]]}, 0, 0), "foo(a)");
+is(IkiWiki::preprocess("foo", "foo", q{[[foo a="""""" b="1"]]}, 0, 0), "foo(a, b => 1)");
+is(IkiWiki::preprocess("foo", "foo", q{[[foo a="""""" b="""1"""]]}, 0, 0), "foo(a, b => 1)");
+is(IkiWiki::preprocess("foo", "foo", q{[[foo a="""""" b=""""""]]}, 0, 0), "foo(a, b)");
+is(IkiWiki::preprocess("foo", "foo", q{[[foo a="" b=""""""]]}, 0, 0), "foo(a, b)");
+is(IkiWiki::preprocess("foo", "foo", q{[[foo a="" b="""1"""]]}, 0, 0), "foo(a, b => 1)");
is(IkiWiki::preprocess("foo", "foo", "[[foo a=\"1 2 3 4\"]]", 0, 0), "foo(a => 1 2 3 4)");
is(IkiWiki::preprocess("foo", "foo", "[[foo ]] then [[foo a=2]]", 0, 0),
"foo() then foo(a => 2)");