use strict;
use IPC::Open2;
-use Test::More tests => 7;
+use Test::More tests => 14;
my $perl = $^X;
my $reaped_pid = waitpid $pid, 0;
is($reaped_pid, $pid, "Reaped PID matches");
is($?, 0, '$? should be zero');
+
+{
+ package SKREEEK;
+ my $pid = IPC::Open2::open2('KAZOP', 'WRITE', $perl, '-e',
+ main::cmd_line('print scalar <STDIN>'));
+ main::cmp_ok($pid, '>', 1, 'got a sane process ID');
+ main::ok(print WRITE "hi kid\n");
+ main::like(<KAZOP>, qr/^hi kid\r?\n$/);
+ main::ok(close(WRITE), "closing WRITE: $!");
+ main::ok(close(KAZOP), "closing READ: $!");
+ my $reaped_pid = waitpid $pid, 0;
+ main::is($reaped_pid, $pid, "Reaped PID matches");
+ main::is($?, 0, '$? should be zero');
+}
}
use strict;
-use Test::More tests => 23;
+use Test::More tests => 24;
use IO::Handle;
use IPC::Open3;
print WRITE "ok $test\n";
waitpid $pid, 0;
+{
+ package YAAH;
+ $pid = IPC::Open3::open3('QWACK_WAAK_WAAK', '>&STDOUT', 'ERROR',
+ $perl, '-e', main::cmd_line('print scalar <STDIN>'));
+ ++$test;
+ no warnings 'once';
+ print QWACK_WAAK_WAAK "ok $test # filenames qualified to their package\n";
+ waitpid $pid, 0;
+}
+
# dup error: This particular case, duping stderr onto the existing
# stdout but putting stdout somewhere else, is a good case because it
# used not to work.