use HTTP::Request::Common;
my %orig_sig;
-BEGIN { %orig_sig = %SIG; }
+BEGIN {
+ %orig_sig = %SIG;
+# perl < 5.8.9 won't set a %SIG entry to undef, it sets it to ''
+ %orig_sig = map { defined $_ ? $_ : '' } %orig_sig
+ if $] < 5.008009;
+}
use Catalyst::Test 'TestCGIBin';
$ENV{MOD_PERL} = "mod_perl/2.0";
is_deeply \%SIG, \%orig_sig, '%SIG is preserved on compile';
-%SIG = %orig_sig;
my $response = request POST '/my-bin/path/test.pl', [
foo => 'bar',
# for some reason the +x is not preserved in the dist
system "chmod +x $Bin/lib/TestCGIBin/root/cgi-bin/test.sh";
+ system "chmod +x $Bin/lib/TestCGIBin/root/cgi-bin/exit_nonzero.sh";
is(get('/my-bin/test.sh'), "Hello!\n", 'Non-Perl CGI File');
+
+ $response = request GET '/my-bin/exit_nonzero.sh';
+ is $response->code, 500, 'Non-Perl CGI with non-zero exit dies';
}
done_testing;