Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions t/02_exit.t
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,28 @@ foreach (1..5,250..255) {

# Single arg tests

run("$perl_path exiter.pl 0");
run("\"$perl_path\" exiter.pl 0");
ok(1,"Implicit zero allowed");

foreach (1..5,250..255) {

eval {
run("$perl_path exiter.pl $_");
run("\"$perl_path\" exiter.pl $_");
};

like($@, qr/unexpectedly returned exit value $_/ );
}

# Testing allowable return values

run([0], "$perl_path exiter.pl 0");
run([0], "\"$perl_path\" exiter.pl 0");
ok(1,"Explcit zero allowed");

run([1], "$perl_path exiter.pl 1");
run([1], "\"$perl_path\" exiter.pl 1");
ok(1,"Explicit allow of exit status 1");

run([-1], "$perl_path exiter.pl 5");
run([-1], "\"$perl_path\" exiter.pl 5");
ok(1,"Exit-all emulation via [-1] allowed");

run(EXIT_ANY, "$perl_path exiter.pl 5");
run(EXIT_ANY, "\"$perl_path\" exiter.pl 5");
ok(1,"Exit-all via EXIT_ANY constant");
2 changes: 1 addition & 1 deletion t/04_capture.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if ($^O ne 'VMS') {

# Win32 systems don't support multi-arg pipes. Our
# simple captures will begin with single-arg tests.
my $output_exe = "$perl_path output.pl";
my $output_exe = "\"$perl_path\" output.pl";

use_ok("IPC::System::Simple","capture");
chdir("t");
Expand Down
8 changes: 7 additions & 1 deletion t/07_taint.t
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
#!/usr/bin/perl -wT
use strict;
use Test::More tests => 13;
use Test::More;
use Scalar::Util qw(tainted);
use Config;

if (exists $INC{"Portable.pm"}) {
plan skip_all => 'Cannot test tainted perlpath under Portable perl';
} else {
plan tests => 13;
}

my $perl_path = $Config{perlpath};

if ($^O ne 'VMS') {
Expand Down
4 changes: 2 additions & 2 deletions t/09_system.t
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ chdir("t"); # Ignore return, since we may already be in t/
system($perl_path,"exiter.pl",0);
ok(1,"Multi-arg system");

system("$perl_path exiter.pl 0");
system("\"$perl_path\" exiter.pl 0");
ok(1,"Single-arg system success");

foreach (1..5,250..255) {
Expand All @@ -36,7 +36,7 @@ foreach (1..5,250..255) {
foreach (1..5,250..255) {

eval {
system("$perl_path exiter.pl $_");
system("\"$perl_path\" exiter.pl $_");
};

like($@, qr/unexpectedly returned exit value $_/, "Single-arg system fail" );
Expand Down
12 changes: 6 additions & 6 deletions t/11_newlines.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ if ($^O ne 'VMS') {
unless $perl_path =~ m/$Config{_exe}$/i;
}

eval { run( "$perl_path -e1" ) };
eval { run( "\"$perl_path\" -e1" ) };
is($@, "", 'Run works with single arg');

eval { run( "$perl_path -e1\n" ) };
eval { run( "\"$perl_path\" -e1\n" ) };
is($@, "", 'Run works with \\n');

eval { run( "$perl_path -e1\r\n") };
eval { run( "\"$perl_path\" -e1\r\n") };
is($@, "", 'Run works with \r\n');

eval { capture( "$perl_path -e1" ) };
eval { capture( "\"$perl_path\" -e1" ) };
is($@, "", 'Run works with single arg');

eval { capture( "$perl_path -e1\n" ) };
eval { capture( "\"$perl_path\" -e1\n" ) };
is($@, "", 'Run works with \\n');

eval { capture( "$perl_path -e1\r\n") };
eval { capture( "\"$perl_path\" -e1\r\n") };
is($@, "", 'Run works with \r\n');
4 changes: 2 additions & 2 deletions t/12_systemx.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if ($^O ne 'VMS') {

chdir("t"); # Ignore return, since we may already be in t/

my $exit_test = "$perl_path exiter.pl 0";
my $exit_test = "\"$perl_path\" exiter.pl 0";

eval {
system($exit_test);
Expand All @@ -32,7 +32,7 @@ eval {
};
is($@,"", "multi-arg systemx works");

my $output_test = "$perl_path output.pl";
my $output_test = "\"$perl_path\" output.pl";

my $output;

Expand Down
6 changes: 3 additions & 3 deletions t/args.t
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ for my $spec (
}

# Make sure redirection works, too.
my $exit = eval { run "$perl output.pl > $tmp" };
my $exit = eval { run "\"$perl\" output.pl > $tmp" };
is $@, "", "Should have no error from run with redirection";
is $exit, 0, "Should have exit 0 from run with redirection";
is $slurp->(), "Hello\nGoodbye\n", "Should have redirected text run";

$exit = eval { system "$perl output.pl > $tmp" };
$exit = eval { system "\"$perl\" output.pl > $tmp" };
is $@, "", "Should have no error from systemx with redirection";
is $exit, 0, "Should have exit 0 from systemx with redirection";
is $slurp->(), "Hello\nGoodbye\n", "Should have redirected text systemx";

# And single-string capture.
my $output = eval { capture "$perl output.pl" };
my $output = eval { capture "\"$perl\" output.pl" };
is $@, "", "Should have no error from single-string capture";
is $output, "Hello\nGoodbye\n", "Should have output from capture";