summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/t/lib/open3.t
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>2000-06-25 11:04:01 +0000
committermarkm <markm@FreeBSD.org>2000-06-25 11:04:01 +0000
commit2618fad5bbb2d0182eb31ed805c41b543c513940 (patch)
tree52ba93338b13aefd02a0055304a9eccfa0e049f5 /contrib/perl5/t/lib/open3.t
parent77644ee620b6a79cf8c538abaf7cd301a875528d (diff)
downloadFreeBSD-src-2618fad5bbb2d0182eb31ed805c41b543c513940.zip
FreeBSD-src-2618fad5bbb2d0182eb31ed805c41b543c513940.tar.gz
Vendor import of Perl 5.006
Diffstat (limited to 'contrib/perl5/t/lib/open3.t')
-rwxr-xr-xcontrib/perl5/t/lib/open3.t18
1 files changed, 16 insertions, 2 deletions
diff --git a/contrib/perl5/t/lib/open3.t b/contrib/perl5/t/lib/open3.t
index b84dac9..7cd0ca3 100755
--- a/contrib/perl5/t/lib/open3.t
+++ b/contrib/perl5/t/lib/open3.t
@@ -2,7 +2,7 @@
BEGIN {
chdir 't' if -d 't';
- @INC = '../lib';
+ unshift @INC, '../lib';
require Config; import Config;
if (!$Config{'d_fork'}
# open2/3 supported on win32 (but not Borland due to CRT bugs)
@@ -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;
+}
OpenPOWER on IntegriCloud