diff options
author | James E Keenan <jkeenan@cpan.org> | 2014-06-21 23:14:46 +0200 |
---|---|---|
committer | James E Keenan <jkeenan@cpan.org> | 2014-06-21 23:14:46 +0200 |
commit | d3ae482b1fbb8a275f4933ce8f7d28aed9e6f166 (patch) | |
tree | 667f2875b48c3894996df142b590e318b1b71429 /ext/IPC-Open3 | |
parent | 30962f6865ad51522f9f4f83ca691414fcb6eac6 (diff) | |
download | perl-d3ae482b1fbb8a275f4933ce8f7d28aed9e6f166.tar.gz |
Fix test file per George Greer comment.
Diffstat (limited to 'ext/IPC-Open3')
-rw-r--r-- | ext/IPC-Open3/t/IPC-Open3.t | 58 |
1 files changed, 31 insertions, 27 deletions
diff --git a/ext/IPC-Open3/t/IPC-Open3.t b/ext/IPC-Open3/t/IPC-Open3.t index a07cc48391..e306aec980 100644 --- a/ext/IPC-Open3/t/IPC-Open3.t +++ b/ext/IPC-Open3/t/IPC-Open3.t @@ -14,7 +14,7 @@ BEGIN { } use strict; -use Test::More tests => 38; +use Test::More tests => 44; use IO::Handle; use IPC::Open3; @@ -188,29 +188,33 @@ foreach my $handle (qw (DUMMY STDIN STDOUT STDERR)) { waitpid $pid, 0; } -## Test that tied STDIN, STDOUT, and STDERR do not cause open3 any discomfort. -## In particular, tied STDERR used to be able to prevent open3 from working -## correctly. RT #119843. -#{ -# { # This just throws things out -# package My::Tied::FH; -# sub TIEHANDLE { bless \my $self } -# sub PRINT {} -# # Note the absence of OPEN and FILENO -# } -# my $message = "japh\n"; -# foreach my $handle (*STDIN, *STDOUT, *STDERR) { -# tie $handle, 'My::Tied::FH'; -# my ($in, $out); -# my $pid = eval { -# open3 $in, $out, undef, $perl, '-ne', 'print'; -# }; -# is($@, '', "no errors calling open3 with tied $handle"); -# print $in $message; -# close $in; -# my $japh = <$out>; -# waitpid $pid, 0; -# is($japh, $message, "read input correctly"); -# untie $handle; -# } -#} +# Test that tied STDIN, STDOUT, and STDERR do not cause open3 any discomfort. +# In particular, tied STDERR used to be able to prevent open3 from working +# correctly. RT #119843. +{ + if (&IPC::Open3::DO_SPAWN) { + skip "Calling open3 with tied filehandles does not work here", 6 + } + + { # This just throws things out + package My::Tied::FH; + sub TIEHANDLE { bless \my $self } + sub PRINT {} + # Note the absence of OPEN and FILENO + } + my $message = "japh\n"; + foreach my $handle (*STDIN, *STDOUT, *STDERR) { + tie $handle, 'My::Tied::FH'; + my ($in, $out); + my $pid = eval { + open3 $in, $out, undef, $perl, '-ne', 'print'; + }; + is($@, '', "no errors calling open3 with tied $handle"); + print $in $message; + close $in; + my $japh = <$out>; + waitpid $pid, 0; + is($japh, $message, "read input correctly"); + untie $handle; + } +} |