From: Rafael Garcia-Suarez Date: Tue, 28 Jul 2009 09:12:54 +0000 (+0200) Subject: Make test pass with -t X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0409250f9c9eac87ff80d18e21856800e91763b5;p=p5sagit%2Fp5-mst-13.2.git Make test pass with -t --- diff --git a/t/op/magic.t b/t/op/magic.t index 95459bc..f8143a2 100644 --- a/t/op/magic.t +++ b/t/op/magic.t @@ -4,6 +4,7 @@ BEGIN { $| = 1; chdir 't' if -d 't'; @INC = '../lib'; + $ENV{PATH} = '/bin' if ${^TAINT}; $SIG{__WARN__} = sub { die "Dying on warning: ", @_ }; require './test.pl'; } @@ -186,6 +187,7 @@ like ($@, qr/^Modification of a read-only value attempted/); # Cygwin turns the symlink into the real file chomp($wd = `pwd`); $wd =~ s#/t$##; + $wd =~ /(.*)/; $wd = $1; # untaint if ($Is_Cygwin) { $wd = Cygwin::win_to_posix_path(Cygwin::posix_to_win_path($wd, 1)); } @@ -244,7 +246,7 @@ EOX EOH } $s1 = "\$^X is $perl, \$0 is $script\n"; - ok open(SCRIPT, ">$script") or diag $!; + ok open(SCRIPT, ">$script") or diag "Can't write to $script: $!"; ok print(SCRIPT $headmaybe . <