summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-05-06 04:36:31 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-05-06 04:36:31 +0000
commit7083d4d1d3a093e255a8035f600174baf7ee1b24 (patch)
tree21703d94dc0d17f595e9b381e462aa3c9c4f4b88 /t
parentac2262e32f030fd3261b89c253e5e7274a51cc53 (diff)
downloadperl-7083d4d1d3a093e255a8035f600174baf7ee1b24.tar.gz
additional test for IPC::Open3 (courtesy RonaldWS@aol.com)
p4raw-id: //depot/perl@3309
Diffstat (limited to 't')
-rwxr-xr-xt/lib/open3.t16
1 files changed, 15 insertions, 1 deletions
diff --git a/t/lib/open3.t b/t/lib/open3.t
index 3a5d1c16df..7cd0ca306c 100755
--- a/t/lib/open3.t
+++ b/t/lib/open3.t
@@ -49,7 +49,7 @@ my ($pid, $reaped_pid);
STDOUT->autoflush;
STDERR->autoflush;
-print "1..21\n";
+print "1..22\n";
# basic
ok 1, $pid = open3 'WRITE', 'READ', 'ERROR', $perl, '-e', cmd_line(<<'EOF');
@@ -134,3 +134,17 @@ EOF
print WRITE "ok 20\n";
print WRITE "ok 21\n";
waitpid $pid, 0;
+
+# command line in single parameter variant of open3
+# for understanding of Config{'sh'} test see exec description in camel book
+my $cmd = 'print(scalar(<STDIN>))';
+$cmd = $Config{'sh'} =~ /sh/ ? "'$cmd'" : cmd_line($cmd);
+eval{$pid = open3 'WRITE', '>&STDOUT', 'ERROR', "$perl -e " . $cmd; };
+if ($@) {
+ print "error $@\n";
+ print "not ok 22\n";
+}
+else {
+ print WRITE "ok 22\n";
+ waitpid $pid, 0;
+}