This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix the syswrite downgrade bug of
[perl5.git] / t / io / print.t
old mode 100644 (file)
new mode 100755 (executable)
index 30294f5..f33aa66
@@ -1,10 +1,16 @@
 #!./perl
 
-# $Header: print.t,v 4.0 91/03/20 01:51:08 lwall Locked $
+BEGIN {
+    chdir 't' if -d 't';
+    @INC = '../lib';
+}
 
-print "1..16\n";
+use strict 'vars';
+use Errno;
 
-$foo = 'STDOUT';
+print "1..19\n";
+
+my $foo = 'STDOUT';
 print $foo "ok 1\n";
 
 print "ok 2\n","ok 3\n","ok 4\n";
@@ -16,7 +22,7 @@ print foo "ok 6\n";
 printf "ok %d\n",7;
 printf("ok %d\n",8);
 
-@a = ("ok %d%c",9,ord("\n"));
+my @a = ("ok %d%c",9,ord("\n"));
 printf @a;
 
 $a[1] = 10;
@@ -27,6 +33,19 @@ $\ = "\n";
 
 print "ok","11";
 
-@x = ("ok","12\nok","13\nok");
-@y = ("15\nok","16");
+my @x = ("ok","12\nok","13\nok");
+my @y = ("15\nok","16");
 print @x,"14\nok",@y;
+{
+    local $\ = "ok 17\n# null =>[\000]\nok 18\n";
+    print "";
+}
+
+if (!exists &Errno::EBADF) {
+    print "ok 19 # skipped: no EBADF\n";
+} else {
+    $! = 0;
+    print NONEXISTENT "foo";
+    print "not " if ($! != &Errno::EBADF);
+    print "ok 19\n";
+}