diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-06-06 12:42:58 +0200 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-06-06 21:42:38 +0200 |
commit | 25dd7e8995357161ee082e6cbee58fd781b673e3 (patch) | |
tree | 42ce8d0d430a0d8c7763bb04eadf8f2861da3189 /ext | |
parent | f144f1e3c6a65ce611177737a21b1166f07ef373 (diff) | |
download | perl-25dd7e8995357161ee082e6cbee58fd781b673e3.tar.gz |
In IPC-Open3.t, merge two similar tests using a loop.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/IPC-Open3/t/IPC-Open3.t | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/ext/IPC-Open3/t/IPC-Open3.t b/ext/IPC-Open3/t/IPC-Open3.t index a29b5509f9..2d86c7fc97 100644 --- a/ext/IPC-Open3/t/IPC-Open3.t +++ b/ext/IPC-Open3/t/IPC-Open3.t @@ -105,29 +105,19 @@ $pid = open3 'WRITE', 'READ', '>&STDOUT', print WRITE "ok $test\n"; waitpid $pid, 0; -# dup reader and error together, both named -$pid = open3 'WRITE', '>&STDOUT', '>&STDOUT', $perl, '-e', cmd_line(<<'EOF'); +foreach (['>&STDOUT', 'both named'], + ['', 'error empty'], + ) { + my ($err, $desc) = @$_; + $pid = open3 'WRITE', '>&STDOUT', $err, $perl, '-e', cmd_line(<<'EOF'); $| = 1; print STDOUT scalar <STDIN>; print STDERR scalar <STDIN>; EOF -++$test; -print WRITE "ok $test\n"; -++$test; -print WRITE "ok $test\n"; -waitpid $pid, 0; - -# dup reader and error together, error empty -$pid = open3 'WRITE', '>&STDOUT', '', $perl, '-e', cmd_line(<<'EOF'); - $| = 1; - print STDOUT scalar <STDIN>; - print STDERR scalar <STDIN>; -EOF -++$test; -print WRITE "ok $test\n"; -++$test; -print WRITE "ok $test\n"; -waitpid $pid, 0; + printf WRITE "ok %d # dup reader and error together, $desc\n", ++$test + for 0, 1; + waitpid $pid, 0; +} # command line in single parameter variant of open3 # for understanding of Config{'sh'} test see exec description in camel book |