This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #65838] Allow here-doc with no final newline
[perl5.git] / t / op / heredoc.t
index 7108c9a..5f48828 100644 (file)
@@ -7,7 +7,7 @@ BEGIN {
 }
 
 use strict;
-plan(tests => 6);
+plan(tests => 7);
 
 
 # heredoc without newline (#65838)
@@ -39,6 +39,12 @@ HEREDOC
         { switches => ['-X'] },
         "blank-terminated heredoc at EOF"
     );
+    fresh_perl_is(
+        "print <<\n$string\n",
+        $string,
+        { switches => ['-X'] },
+        "blank-terminated heredoc at EOF and no semicolon"
+    );
 }