diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-06-29 08:26:36 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-06-29 08:26:36 +0000 |
commit | 5152d7c70255adc94c2a3e2b618f1dda3b081e12 (patch) | |
tree | 412a04d734e1ddf89ae79fb5a796c3b492df6920 /t | |
parent | a9332b4ad63f5e28b9c5fd64a3ea35e9db2df408 (diff) | |
download | perl-5152d7c70255adc94c2a3e2b618f1dda3b081e12.tar.gz |
bump patchlevel to 69, various little tweaks (tested on win32, Solaris
under several build configurations)
p4raw-id: //depot/perl@1262
Diffstat (limited to 't')
-rwxr-xr-x | t/lib/cgi-function.t | 30 | ||||
-rwxr-xr-x | t/lib/cgi-request.t | 32 |
2 files changed, 37 insertions, 25 deletions
diff --git a/t/lib/cgi-function.t b/t/lib/cgi-function.t index 3fbea1fb0d..ad8b968161 100755 --- a/t/lib/cgi-function.t +++ b/t/lib/cgi-function.t @@ -10,6 +10,7 @@ BEGIN { BEGIN {$| = 1; print "1..24\n"; } END {print "not ok 1\n" unless $loaded;} +use Config; use CGI (':standard','keywords'); $loaded = 1; print "ok 1\n"; @@ -64,16 +65,21 @@ $ENV{QUERY_STRING}='mary+had+a+little+lamb'; test(21,join(' ',keywords()) eq 'mary had a little lamb','CGI::keywords'); test(22,join(' ',param('keywords')) eq 'mary had a little lamb','CGI::keywords'); -CGI::_reset_globals; -$test_string = 'game=soccer&game=baseball&weather=nice'; -$ENV{REQUEST_METHOD}='POST'; -$ENV{CONTENT_LENGTH}=length($test_string); -$ENV{QUERY_STRING}='big_balls=basketball&small_balls=golf'; -if (open(CHILD,"|-")) { # cparent - print CHILD $test_string; - close CHILD; - exit 0; +if (!$Config{d_fork} or $^O eq 'MSWin32' or $^O eq 'VMS') { + for (23,24) { print "ok $_ # Skipped: fork n/a\n" } +} +else { + CGI::_reset_globals; + $test_string = 'game=soccer&game=baseball&weather=nice'; + $ENV{REQUEST_METHOD}='POST'; + $ENV{CONTENT_LENGTH}=length($test_string); + $ENV{QUERY_STRING}='big_balls=basketball&small_balls=golf'; + if (open(CHILD,"|-")) { # cparent + print CHILD $test_string; + close CHILD; + exit 0; + } + # 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()"); } -# 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()"); diff --git a/t/lib/cgi-request.t b/t/lib/cgi-request.t index 12b2e34239..8c70c40350 100755 --- a/t/lib/cgi-request.t +++ b/t/lib/cgi-request.t @@ -10,6 +10,7 @@ BEGIN { BEGIN {$| = 1; print "1..31\n"; } END {print "not ok 1\n" unless $loaded;} +use Config; use CGI (); $loaded = 1; print "ok 1\n"; @@ -71,17 +72,22 @@ test(26,$q->param('foo') eq 'bar','CGI::param() redux'); test(27,$q=new CGI({'foo'=>'bar','bar'=>'froz'}),"CGI::new() redux 2"); test(28,$q->param('bar') eq 'froz',"CGI::param() redux 2"); -$q->_reset_globals; -$test_string = 'game=soccer&game=baseball&weather=nice'; -$ENV{REQUEST_METHOD}='POST'; -$ENV{CONTENT_LENGTH}=length($test_string); -$ENV{QUERY_STRING}='big_balls=basketball&small_balls=golf'; -if (open(CHILD,"|-")) { # cparent - print CHILD $test_string; - close CHILD; - exit 0; +if (!$Config{d_fork} or $^O eq 'MSWin32' or $^O eq 'VMS') { + for (29..31) { print "ok $_ # Skipped: fork n/a\n" } +} +else { + $q->_reset_globals; + $test_string = 'game=soccer&game=baseball&weather=nice'; + $ENV{REQUEST_METHOD}='POST'; + $ENV{CONTENT_LENGTH}=length($test_string); + $ENV{QUERY_STRING}='big_balls=basketball&small_balls=golf'; + if (open(CHILD,"|-")) { # cparent + print CHILD $test_string; + close CHILD; + exit 0; + } + # at this point, we're in a new (child) process + test(29,$q=new CGI,"CGI::new() from POST"); + test(30,$q->param('weather') eq 'nice',"CGI::param() from POST"); + test(31,$q->url_param('big_balls') eq 'basketball',"CGI::url_param()"); } -# at this point, we're in a new (child) process -test(29,$q=new CGI,"CGI::new() from POST"); -test(30,$q->param('weather') eq 'nice',"CGI::param() from POST"); -test(31,$q->url_param('big_balls') eq 'basketball',"CGI::url_param()"); |