summaryrefslogtreecommitdiff
path: root/t/io
diff options
context:
space:
mode:
authorArtur Bergman <sky@nanisky.com>2003-04-28 15:32:35 +0000
committerArtur Bergman <sky@nanisky.com>2003-04-28 15:32:35 +0000
commitd67aa87a1383860a50a1cda017e175d17b66c122 (patch)
treed6c96a6ee1c62f6c301b482dbd5a6176e78c22cb /t/io
parent57c6e6d2d6e8e7d8865d21652c7b582d8731722b (diff)
downloadperl-d67aa87a1383860a50a1cda017e175d17b66c122.tar.gz
Fix bug 2681, change the test not to use the shell and use 3+arg
open. p4raw-id: //depot/perl@19363
Diffstat (limited to 't/io')
-rwxr-xr-xt/io/openpid.t21
1 files changed, 12 insertions, 9 deletions
diff --git a/t/io/openpid.t b/t/io/openpid.t
index c6ed840225..2dec677bcb 100755
--- a/t/io/openpid.t
+++ b/t/io/openpid.t
@@ -25,7 +25,6 @@ $| = 1;
$SIG{PIPE} = 'IGNORE';
my $perl = which_perl();
-$perl .= qq[ "-I../lib"];
#
# commands run 4 perl programs. Two of these programs write a
@@ -34,18 +33,22 @@ $perl .= qq[ "-I../lib"];
# the other reader reads one line, waits a few seconds and then
# exits to test the waitpid function.
#
-$cmd1 = qq/$perl -e "\$|=1; print qq[first process\\n]; sleep 30;"/;
-$cmd2 = qq/$perl -e "\$|=1; print qq[second process\\n]; sleep 30;"/;
-$cmd3 = qq/$perl -e "print <>;"/; # hangs waiting for end of STDIN
-$cmd4 = qq/$perl -e "print scalar <>;"/;
+@cmd1 = ($perl,'-I../lib','-e',
+ q{$|=1; print qq[first process\n]; sleep 300;});
+@cmd2 = ($perl,'-I../lib','-e',
+ q{$|=1; print qq[second process\n]; sleep 30;});
+@cmd3 = ($perl,'-I../lib','-e',
+ "print <>;"); # hangs waiting for end of STDIN
+@cmd4 = ($perl,'-I../lib','-e',
+ "print scalar <>;");
#warn "#$cmd1\n#$cmd2\n#$cmd3\n#$cmd4\n";
# start the processes
-ok( $pid1 = open(FH1, "$cmd1 |"), 'first process started');
-ok( $pid2 = open(FH2, "$cmd2 |"), ' second' );
-ok( $pid3 = open(FH3, "| $cmd3"), ' third' );
-ok( $pid4 = open(FH4, "| $cmd4"), ' fourth' );
+ok( $pid1 = open(FH1, "-|", @cmd1), 'first process started');
+ok( $pid2 = open(FH2, "-|", @cmd2), ' second' );
+ok( $pid3 = open(FH3, "|-", @cmd3), ' third' );
+ok( $pid4 = open(FH4, "|-", @cmd4), ' fourth' );
print "# pids were $pid1, $pid2, $pid3, $pid4\n";