This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #114040] Parse here-docs correctly in quoted constructs
[perl5.git] / t / comp / parser.t
index 53b7afa..44fc982 100644 (file)
@@ -3,7 +3,7 @@
 # Checks if the parser behaves correctly in edge cases
 # (including weird syntax errors)
 
 # Checks if the parser behaves correctly in edge cases
 # (including weird syntax errors)
 
-print "1..141\n";
+print "1..144\n";
 
 sub failed {
     my ($got, $expected, $name) = @_;
 
 sub failed {
     my ($got, $expected, $name) = @_;
@@ -416,6 +416,20 @@ is $@, "", 'pod inside string in string eval';
 }";
 print "ok ", ++$test, " - pod inside string outside of string eval\n";
 
 }";
 print "ok ", ++$test, " - pod inside string outside of string eval\n";
 
+like "blah blah blah\n", qr/${\ <<END
+blah blah blah
+END
+ }/, 'here docs in multiline quoted construct';
+like "blah blah blah\n", eval q|qr/${\ <<END
+blah blah blah
+END
+ }/|, 'here docs in multiline quoted construct in string eval';
+
+# Unterminated here-docs in subst in eval; used to crash
+eval 's/${<<END}//';
+eval 's//${<<END}/';
+print "ok ", ++$test, " - unterminated here-docs in s/// in string eval\n";
+
 sub 'Hello'_he_said (_);
 is prototype "Hello::_he_said", '_', 'initial tick in sub declaration';
 
 sub 'Hello'_he_said (_);
 is prototype "Hello::_he_said", '_', 'initial tick in sub declaration';