use strict;
use IPC::Open2;
-use Test::More tests => 14;
+use Test::More tests => 15;
my $perl = $^X;
main::is($reaped_pid, $pid, "Reaped PID matches");
main::is($?, 0, '$? should be zero');
}
+
+$pid = eval { open2('READ', '', $perl, '-e', cmd_line('print scalar <STDIN>')) };
+like($@, qr/^open2: Modification of a read-only value attempted at /,
+ 'open2 faults read-only parameters correctly') or do {waitpid $pid, 0};
}
use strict;
-use Test::More tests => 24;
+use Test::More tests => 25;
use IO::Handle;
use IPC::Open3;
} else {
isnt($@, '') or do {waitpid $pid, 0};
}
+
+$pid = eval { open3 'WRITE', '', 'ERROR', '/non/existent/program'; };
+like($@, qr/^open3: Modification of a read-only value attempted at /,
+ 'open3 faults read-only parameters correctly') or do {waitpid $pid, 0};