diff options
Diffstat (limited to 't/lib/open2.t')
-rwxr-xr-x | t/lib/open2.t | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/t/lib/open2.t b/t/lib/open2.t index 1cf325a875..a2e6a07a7b 100755 --- a/t/lib/open2.t +++ b/t/lib/open2.t @@ -3,6 +3,11 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; + require Config; import Config; + unless ($Config{'d_fork'}) { + print "1..0\n"; + exit 0; + } # make warnings fatal $SIG{__WARN__} = sub { die @_ }; } @@ -12,6 +17,8 @@ use IO::Handle; use IPC::Open2; #require 'open2.pl'; use subs 'open2'; +my $perl = './perl'; + sub ok { my ($n, $result, $info) = @_; if ($result) { @@ -29,7 +36,7 @@ STDERR->autoflush; print "1..7\n"; -ok 1, $pid = open2 'READ', 'WRITE', $^X, '-e', 'print scalar <STDIN>'; +ok 1, $pid = open2 'READ', 'WRITE', $perl, '-e', 'print scalar <STDIN>'; ok 2, print WRITE "hi kid\n"; ok 3, <READ> eq "hi kid\n"; ok 4, close(WRITE), $!; |