]> sipb.mit.edu Git - ikiwiki.git/blobdiff - t/preprocess.t
I still don't think 'rtl' is a suitable name for this switch
[ikiwiki.git] / t / preprocess.t
index 7bb9878d0fdbfd16d2db04af6190bf11209c50c2..2211e8471dce0b3dad7a54d0a19e2562a3637596 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 use warnings;
 use strict;
-use Test::More tests => 31;
+use Test::More tests => 34;
 
 BEGIN { use_ok("IkiWiki"); }
 
@@ -67,10 +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."\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");
 }