summaryrefslogtreecommitdiff
path: root/t/lib/cgi-function.t
diff options
context:
space:
mode:
Diffstat (limited to 't/lib/cgi-function.t')
-rwxr-xr-xt/lib/cgi-function.t18
1 files changed, 7 insertions, 11 deletions
diff --git a/t/lib/cgi-function.t b/t/lib/cgi-function.t
index 934e27cdc9..87ce5d4438 100755
--- a/t/lib/cgi-function.t
+++ b/t/lib/cgi-function.t
@@ -1,12 +1,8 @@
-#!./perl
+#!/usr/local/bin/perl -w
# Test ability to retrieve HTTP request info
######################### We start with some black magic to print on failure.
-
-BEGIN {
- chdir 't' if -d 't';
- unshift @INC, '../lib' if -d '../lib';
-}
+use lib '../blib/lib','../blib/arch';
BEGIN {$| = 1; print "1..27\n"; }
END {print "not ok 1\n" unless $loaded;}
@@ -80,12 +76,12 @@ if ($Config{d_fork}) {
}
# at this point, we're in a new (child) process
test(23,param('weather') eq 'nice',"CGI::param() from POST");
- test(24,url_param('big_balls') eq 'basketball',"CGI::url_param()");
+ test(24,(url_param('big_balls') eq 'basketball'),"CGI::url_param()");
} else {
print "ok 23 # Skip\n";
print "ok 24 # Skip\n";
}
-
-test(25,redirect('http://somewhere.else') eq "Status: 302 Moved${CRLF}Location: http://somewhere.else${CRLF}${CRLF}","CGI::redirect() 1");
-test(26,redirect(-Location=>'http://somewhere.else',-Type=>'text/html') eq "Status: 302 Moved${CRLF}Location: http://somewhere.else${CRLF}Content-Type: text/html; charset=ISO-8859-1${CRLF}${CRLF}","CGI::redirect() 2");
-test(27,redirect(-Location=>'http://somewhere.else/bin/foo&bar',-Type=>'text/html') eq "Status: 302 Moved${CRLF}Location: http://somewhere.else/bin/foo&bar${CRLF}Content-Type: text/html; charset=ISO-8859-1${CRLF}${CRLF}","CGI::redirect() 2");
+test(25,redirect('http://somewhere.else') eq "Status: 302 Moved${CRLF}location: http://somewhere.else${CRLF}${CRLF}","CGI::redirect() 1");
+my $h = redirect(-Location=>'http://somewhere.else',-Type=>'text/html');
+test(26,$h eq "Status: 302 Moved${CRLF}location: http://somewhere.else${CRLF}Content-Type: text/html; charset=ISO-8859-1${CRLF}${CRLF}","CGI::redirect() 2");
+test(27,redirect(-Location=>'http://somewhere.else/bin/foo&bar',-Type=>'text/html') eq "Status: 302 Moved${CRLF}location: http://somewhere.else/bin/foo&bar${CRLF}Content-Type: text/html; charset=ISO-8859-1${CRLF}${CRLF}","CGI::redirect() 2");