aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorTimo Paulssen <timonator@perpetuum-immobile.de>2011-05-01 02:37:18 +0200
committerJoey Hess <joey@kitenet.net>2011-05-13 11:24:16 -0400
commit8e120bf7182e93f27d4afa446193986e6309b485 (patch)
tree1d9d8b47a7d1e3e08318b0724217325ce770597c /t
parent505439cc0abe814a9dffd24224b8b660db0d3624 (diff)
downloadikiwiki-8e120bf7182e93f27d4afa446193986e6309b485.tar
ikiwiki-8e120bf7182e93f27d4afa446193986e6309b485.tar.gz
added test cases for heredoc and triple-single.
Diffstat (limited to 't')
-rwxr-xr-xt/preprocess.t14
1 files changed, 8 insertions, 6 deletions
diff --git a/t/preprocess.t b/t/preprocess.t
index 4a140bb61..2211e8471 100755
--- a/t/preprocess.t
+++ b/t/preprocess.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use warnings;
use strict;
-use Test::More tests => 33;
+use Test::More tests => 34;
BEGIN { use_ok("IkiWiki"); }
@@ -67,15 +67,17 @@ is(IkiWiki::preprocess("foo", "foo", $long, 0, 0), $long,
is(IkiWiki::preprocess("foo", "foo", $long."]]", 0, 0), $long."]]",
"unterminated triple-quoted string is not treated as a bare word");
-is(IkiWiki::preprocess("foo", "foo", "[[!foo a=<<HEREDOC\n".$multiline."\nHERE]]", 0, 0),
- "foo(a => $multiline)", "heredoc for key");
-is(IkiWiki::preprocess("foo", "foo", "[[!foo <<HEREDOC\n".$multiline."\nHERE]]", 0, 0),
- "foo($multiline)", "heredoc for keyless");
+is(IkiWiki::preprocess("foo", "foo", "[[!foo a=<<HEREDOC\n".$multiline."\nHEREDOC]]", 0, 0),
+ "foo(a => $multiline)", "nested strings via heredoc (for key)");
+is(IkiWiki::preprocess("foo", "foo", "[[!foo <<HEREDOC\n".$multiline."\nHEREDOC]]", 0, 0),
+ "foo($multiline)", "nested strings via heredoc (without keyless)");
+is(IkiWiki::preprocess("foo", "foo", "[[!foo '''".$multiline."''']]", 0, 0),
+ "foo($multiline)", "triple-single-quoted multiline string");
TODO: {
local $TODO = "nested strings not yet implemented";
$multiline='here is a string containing another [[foo val="""string""]]';
is(IkiWiki::preprocess("foo", "foo", '[[foo a="""'.$multiline.'"""]]', 0, 0),
- "foo(a=> $multiline)", "nested multiline strings");
+ "foo(a => $multiline)", "nested multiline strings");
}