Skip to content

Commit

Permalink
fix t/85-crt-glob.t on Windows
Browse files Browse the repository at this point in the history
Perl messes up the quoting of arguments of system(LIST) if
some elements of LIST contain double quotes. Add a check in t/utils.pm
so I won't get tripped up by this again.
  • Loading branch information
rschupp committed Apr 3, 2018
1 parent cec332c commit 06a5219
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion t/85-crt-glob.t
Expand Up @@ -8,6 +8,6 @@ require "./t/utils.pl";

plan tests => 3;

my $exe = pp_ok(-e => 'for (my $i = 0; $i < @ARGV; $i++) { printf "%d#%s\n", $i, $ARGV[$i]; }');
my $exe = pp_ok(-e => 'for (my $i = 0; $i < @ARGV; $i++) { printf qq[%d#%s\n], $i, $ARGV[$i]; }');
my ($out) = run_ok($exe, '*');
is($out, "0#*\n", "no globbing of arguments");
2 changes: 2 additions & 0 deletions t/utils.pl
Expand Up @@ -20,6 +20,8 @@ sub pp_ok
my $exe = catfile($ENV{PAR_TMPDIR},"packed$Config{_exe}");
unlink($exe);

die "system(LIST) with double quotes in LIST doesn't work on Windows: @_"
if grep { /"/ } @_;
system($^X, $pp, -o => $exe, @_);
# Note: -x is unreliable on Windows
ok( $? == 0 && -f $exe, qq[successfully packed "$exe"] );
Expand Down

0 comments on commit 06a5219

Please sign in to comment.