In perl.git, the branch topic/indented-here-docs has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/b33ca6d128c84488244406a870b8619fe9b5bcee?hp=ff554f6a9f6b0fdffbc2598f4bb17c2f818febf9>

- Log -----------------------------------------------------------------
commit b33ca6d128c84488244406a870b8619fe9b5bcee
Author: Matthew Horsfall <[email protected]>
Date:   Thu Jun 30 21:01:52 2016 -0400

    Add a test case for indented heredocs with no indentation.
-----------------------------------------------------------------------

Summary of changes:
 t/op/heredoc.t | 9 ++++++++-
 toke.c         | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/t/op/heredoc.t b/t/op/heredoc.t
index 01191f3..4a96c84 100644
--- a/t/op/heredoc.t
+++ b/t/op/heredoc.t
@@ -7,7 +7,7 @@ BEGIN {
 }
 
 use strict;
-plan(tests => 48);
+plan(tests => 49);
 
 
 # heredoc without newline (#65838)
@@ -113,6 +113,13 @@ HEREDOC
     my $string = 'some data';
 
     fresh_perl_is(
+        "print <<~HEREDOC;\n  ${string}\nHEREDOC\n",
+        "  $string",
+        { switches => ['-w'], stderr => 1 },
+        "indented heredoc with no actual indentation"
+    );
+
+    fresh_perl_is(
         "print <<~HEREDOC;\n  ${string}\n  HEREDOC\n",
         $string,
         { switches => ['-w'], stderr => 1 },
diff --git a/toke.c b/toke.c
index 1789af8..766420f 100644
--- a/toke.c
+++ b/toke.c
@@ -9779,6 +9779,7 @@ S_scan_heredoc(pTHX_ char *s)
                sv_catpvn(newstr, ss, le);
 
                ss += le;
+
            /* Line doesn't begin with our indentation? Warn */
            } else {
                STRLEN le = 0;

--
Perl5 Master Repository

Reply via email to