This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Convert t/op/anonsub.t to test.pl, strict and warnings.
[perl5.git] / t / io / print.t
old mode 100755 (executable)
new mode 100644 (file)
index 31d559a..321eb1e
@@ -3,13 +3,14 @@
 BEGIN {
     chdir 't' if -d 't';
     @INC = '../lib';
+    require './test.pl';
+    eval 'use Errno';
+    die $@ if $@ and !is_miniperl();
 }
 
 use strict 'vars';
-eval 'use Errno';
-die $@ if $@ and !$ENV{PERL_CORE_MINITEST};
 
-print "1..19\n";
+print "1..21\n";
 
 my $foo = 'STDOUT';
 print $foo "ok 1\n";
@@ -48,7 +49,20 @@ if (!exists &Errno::EBADF) {
     print "ok 19 # skipped: no EBADF\n";
 } else {
     $! = 0;
+    no warnings 'unopened';
     print NONEXISTENT "foo";
     print "not " if ($! != &Errno::EBADF);
     print "ok 19\n";
 }
+
+{
+    # Change 26009: pp_print didn't extend the stack
+    #               before pushing its return value
+    # to make sure only that these obfuscated sentences will not crash.
+
+    map print(reverse), ('')x68;
+    print "ok 20\n";
+
+    map print(+()), ('')x68;
+    print "ok 21\n";
+}