Skip to content
Browse files

more heredoc patches

  • Loading branch information...
1 parent 79af625 commit c02bce1e6d341d029cbb4a4a5c247dd5c6875d79 @timo timo committed
Showing with 28 additions and 1 deletion.
  1. +28 −1 S02-literals/heredocs.t
View
29 S02-literals/heredocs.t
@@ -1,5 +1,5 @@
use Test;
-plan 10;
+plan 13;
my $foo = "FOO";
my $bar = "BAR";
@@ -89,3 +89,30 @@ $multiline = "Hello\n World";
is no-r(@q[0]), "first line\nHello\n World something\nanother line\n", "extra spaces after interpolation will be kept";
}
+
+{
+ my ($one, $two) = <foo bar>;
+ my @q = qq:to/END/;
+ {$one}{$two}
+ stuff
+ END
+
+ is no-r(@q[0]), "foobar\nstuff\n", "interpolations without constant strings in the middle";
+
+ my @q2 = qq:to/END/;
+ stuff
+ {$one}{$two}
+ END
+
+ is no-r(@q2[0]), "stuff\nfoobar\n", "interpolations at the very end";
+
+ my @q3 = qq:to/END/;
+ line one
+
+ line two
+
+ $one
+ END
+
+ is no-r(@q3[0]), "line one\n\nline two\n\nfoo\n", "empty lines";
+}

0 comments on commit c02bce1

Please sign in to comment.
Something went wrong with that request. Please try again.