X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fop%2Fexec.t;h=c23364b29d4707bb959392eb46e6e86b0c34a387;hb=1db36481d13cc744ff50a6e79d19885d5071f098;hp=4c1b36ae2e578052212e76ab9b4338135340720a;hpb=d6b7ef8642dbff7f74dde11fd4995a37e8f38c04;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/op/exec.t b/t/op/exec.t index 4c1b36a..c23364b 100755 --- a/t/op/exec.t +++ b/t/op/exec.t @@ -1,6 +1,6 @@ #!./perl -BEGIN: { +BEGIN { chdir 't' if -d 't'; @INC = ('../lib'); require './test.pl'; @@ -17,7 +17,9 @@ $ENV{LANGUAGE} = 'C'; # Ditto in GNU. my $Is_VMS = $^O eq 'VMS'; my $Is_Win32 = $^O eq 'MSWin32'; -plan(tests => 20); +skip_all("Tests mostly usesless on MacOS") if $^O eq 'MacOS'; + +plan(tests => 22); my $Perl = which_perl(); @@ -72,6 +74,12 @@ is( $echo_out, "ok\n", 'piped echo emulation'); is( scalar `$Perl -le "print 'ok'" | $Perl -e "print "`, "ok\n", 'extra newlines on outgoing pipes'); + + { + local($/) = \2; + $out = runperl(prog => 'print q{1234}'); + is($out, "1234", 'ignore $/ when capturing output in scalar context'); + } } @@ -81,15 +89,14 @@ my $exit_one = $Is_VMS ? 4 << 8 : 1 << 8; is( system(qq{$Perl "-I../lib" -e "use vmsish qw(hushed); exit 1"}), $exit_one, 'Explicit exit of 1' ); - -$rc = system "lskdfj"; +$rc = system { "lskdfj" } "lskdfj"; unless( ok($rc == 255 << 8 or $rc == -1 or $rc == 256 or $rc == 512) ) { print "# \$rc == $rc\n"; } unless ( ok( $! == 2 or $! =~ /\bno\b.*\bfile/i or $! == 13 or $! =~ /permission denied/i or - $! == 22 or $! =~ /invalid argument/ ) ) { + $! == 22 or $! =~ /invalid argument/i ) ) { printf "# \$! eq %d, '%s'\n", $!, $!; } @@ -99,6 +106,10 @@ is( <<`END`, "ok\n", '<<`HEREDOC`' ); $Perl -le "print 'ok'" END +{ + my $_ = qq($Perl -le "print 'ok'"); + is( readpipe, "ok\n", 'readpipe default argument' ); +} TODO: { my $tnum = curr_test();