Permalink
Browse files

add tab tests for heredocs

  • Loading branch information...
1 parent 73f8c5b commit 978e4a8ac166821ab18a8c02c906063b6e489dd6 @timo timo committed Aug 1, 2013
Showing with 24 additions and 1 deletion.
  1. +24 −1 S02-literals/heredocs.t
View
@@ -1,5 +1,5 @@
use Test;
-plan 13;
+plan 16;
my $foo = "FOO";
my $bar = "BAR";
@@ -116,3 +116,26 @@ $multiline = "Hello\n World";
is no-r(@q3[0]), "line one\n\nline two\n\nfoo\n", "empty lines";
}
+
+{
+ my @q = qq:to/END/;
+ stuff
+ stuff
+ END
+
+ is no-r(@q[0]), "stuff\nstuff\n", "Tabs get correctly removed";
+
+ my @q2 = qq:to/END/;
+ stuff
+ barfoo
+ END
+
+ is no-r(@q2[0]), "stuff\nbarfoo\n", "mixed tabs and spaces get correctly removed";
+
+ my @q3 = qq:to/END/;
+ line one
+ line two
+ END
+
+ is no-r(@q3[0]), "line one\nline two\n", "mixing tabs and spaces even more evil-ly";
+}

0 comments on commit 978e4a8

Please sign in to comment.