diff options
author | Larry Wall <lwall@jpl-devvax.jpl.nasa.gov> | 1990-02-28 21:55:09 +0000 |
---|---|---|
committer | Larry Wall <lwall@jpl-devvax.jpl.nasa.gov> | 1990-02-28 21:55:09 +0000 |
commit | ac58e20f744208e9bff2115708a2f1c4e2e2175f (patch) | |
tree | 1610ffeb1ed9dc24b5bf864c012a6d9fe7ac6720 /t | |
parent | afd9f252e30d37007c653bd21680f0b5f6c32608 (diff) | |
download | perl-ac58e20f744208e9bff2115708a2f1c4e2e2175f.tar.gz |
perl 3.0 patch #11 patch #9, continued
See patch #9.
Diffstat (limited to 't')
-rw-r--r-- | t/io.pipe | 43 | ||||
-rw-r--r-- | t/op.mkdir | 4 | ||||
-rw-r--r-- | t/op.stat | 8 | ||||
-rw-r--r-- | t/op.subst | 4 |
4 files changed, 49 insertions, 10 deletions
@@ -1,9 +1,9 @@ #!./perl -# $Header: io.pipe,v 3.0 89/10/18 15:26:30 lwall Locked $ +# $Header: io.pipe,v 3.0.1.1 90/02/28 18:32:41 lwall Locked $ $| = 1; -print "1..4\n"; +print "1..8\n"; open(PIPE, "|-") || (exec 'tr', '[A-Z]', '[a-z]'); print PIPE "OK 1\n"; @@ -12,10 +12,45 @@ close PIPE; if (open(PIPE, "-|")) { while(<PIPE>) { + s/^not //; print; } } else { - print STDOUT "ok 3\n"; - exec 'echo', 'ok 4'; + print STDOUT "not ok 3\n"; + exec 'echo', 'not ok 4'; } + +pipe(READER,WRITER) || die "Can't open pipe"; + +if ($pid = fork) { + close WRITER; + while(<READER>) { + s/^not //; + y/A-Z/a-z/; + print; + } +} +else { + die "Couldn't fork" unless defined $pid; + close READER; + print WRITER "not ok 5\n"; + open(STDOUT,">&WRITER") || die "Can't dup WRITER to STDOUT"; + close WRITER; + exec 'echo', 'not ok 6'; +} + + +pipe(READER,WRITER) || die "Can't open pipe"; +close READER; + +$SIG{'PIPE'} = 'broken_pipe'; + +sub broken_pipe { + print "ok 7\n"; +} + +print WRITER "not ok 7\n"; +close WRITER; + +print "ok 8\n"; diff --git a/t/op.mkdir b/t/op.mkdir index 99e04b0057..7c13e994dd 100644 --- a/t/op.mkdir +++ b/t/op.mkdir @@ -1,6 +1,6 @@ #!./perl -# $Header: op.mkdir,v 3.0.1.1 89/11/11 05:00:47 lwall Locked $ +# $Header: op.mkdir,v 3.0.1.2 90/02/28 18:35:31 lwall Locked $ print "1..7\n"; @@ -12,4 +12,4 @@ print ($! =~ /exists/ ? "ok 3\n" : "not ok 3\n"); print (-d 'blurfl' ? "ok 4\n" : "not ok 4\n"); print (rmdir('blurfl') ? "ok 5\n" : "not ok 5\n"); print (rmdir('blurfl') ? "not ok 6\n" : "ok 6\n"); -print ($! =~ /such/ ? "ok 7\n" : "not ok 7\n"); +print ($! =~ /such|exist/ ? "ok 7\n" : "not ok 7\n"); @@ -1,6 +1,6 @@ #!./perl -# $Header: op.stat,v 3.0.1.2 89/11/17 15:39:27 lwall Locked $ +# $Header: op.stat,v 3.0.1.3 90/02/28 18:36:51 lwall Locked $ print "1..56\n"; @@ -88,11 +88,15 @@ if (! -b '.') {print "ok 34\n";} else {print "not ok 34\n";} $cnt = $uid = 0; -while (</usr/bin/*>) { +chop($cwd = `pwd`); +die "Can't run op.stat test 35 without pwd working" unless $cwd; +chdir '/usr/bin' || die "Can't cd to /usr/bin"; +while (<*>) { $cnt++; $uid++ if -u; last if $uid && $uid < $cnt; } +chdir $cwd || die "Can't cd back to $cwd"; # I suppose this is going to fail somewhere... if ($uid > 0 && $uid < $cnt) {print "ok 35\n";} else {print "not ok 35\n";} diff --git a/t/op.subst b/t/op.subst index e3bf6e2209..a3d45ea506 100644 --- a/t/op.subst +++ b/t/op.subst @@ -1,6 +1,6 @@ #!./perl -# $Header: op.subst,v 3.0 89/10/18 15:31:43 lwall Locked $ +# $Header: op.subst,v 3.0.1.1 90/02/28 18:37:30 lwall Locked $ print "1..42\n"; @@ -42,7 +42,7 @@ if (/a/i && s///gi && $_ eq 'BCD') {print "ok 8\n";} else {print "not ok 8 $_\n" $_ = '\\' x 4; if (length($_) == 4) {print "ok 9\n";} else {print "not ok 9\n";} s/\\/\\\\/g; -if ($_ eq '\\' x 8) {print "ok 10\n";} else {print "not ok 10\n";} +if ($_ eq '\\' x 8) {print "ok 10\n";} else {print "not ok 10 $_\n";} $_ = '\/' x 4; if (length($_) == 8) {print "ok 11\n";} else {print "not ok 11\n";} |