X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCGI%2Ft%2Fform.t;h=dd8338c596f899ae89c933520c4817a2c2c0d3ff;hb=f5f48b4d8916a5316bf55ddba4047be421aaecfe;hp=612e2e165017e7f38f53466aff5d952e29c23299;hpb=3acbd4f53b544ab36759ef8cf0a6fcc4f696a8d0;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/CGI/t/form.t b/lib/CGI/t/form.t index 612e2e1..dd8338c 100755 --- a/lib/CGI/t/form.t +++ b/lib/CGI/t/form.t @@ -1,16 +1,8 @@ #!/usr/local/bin/perl -w -BEGIN { - chdir 't' if -d 't'; - if ($ENV{PERL_CORE}) { - @INC = '../lib'; - } else { - # Due to a bug in older versions of MakeMaker & Test::Harness, - # we must ensure the blib's are in @INC, else we might use - # the core CGI.pm - unshift @INC, qw( ../blib/lib ../blib/arch ../lib ); - } -} +# Due to a bug in older versions of MakeMaker & Test::Harness, we must +# ensure the blib's are in @INC, else we might use the core CGI.pm +use lib qw(. ./blib/lib ./blib/arch); use Test::More tests => 17; @@ -37,47 +29,47 @@ $ENV{SERVER_PORT} = 8080; $ENV{SERVER_NAME} = 'the.good.ship.lollypop.com'; is(start_form(-action=>'foobar',-method=>'get'), - qq(
\n), + qq(\n), "start_form()"); is(submit(), - qq(), + qq(), "submit()"); is(submit(-name => 'foo', -value => 'bar'), - qq(), + qq(), "submit(-name,-value)"); is(submit({-name => 'foo', -value => 'bar'}), - qq(), + qq(), "submit({-name,-value})"); is(textfield(-name => 'weather'), - qq(), + qq(), "textfield({-name})"); is(textfield(-name => 'weather', -value => 'nice'), - qq(), + qq(), "textfield({-name,-value})"); is(textfield(-name => 'weather', -value => 'nice', -override => 1), - qq(), + qq(), "textfield({-name,-value,-override})"); is(checkbox(-name => 'weather', -value => 'nice'), - qq(weather), + qq(), "checkbox()"); is(checkbox(-name => 'weather', -value => 'nice', -label => 'forecast'), - qq(forecast), + qq(), "checkbox()"); is(checkbox(-name => 'weather', @@ -85,50 +77,43 @@ is(checkbox(-name => 'weather', -label => 'forecast', -checked => 1, -override => 1), - qq(forecast), + qq(), "checkbox()"); is(checkbox(-name => 'weather', -value => 'dull', -label => 'forecast'), - qq(forecast), + qq(), "checkbox()"); is(radio_group(-name => 'game'), - qq(chess ). - qq(checkers), + qq( ), 'radio_group()'); is(radio_group(-name => 'game', -labels => {'chess' => 'ping pong'}), - qq(ping pong ). - qq(checkers), + qq( ), 'radio_group()'); is(checkbox_group(-name => 'game', -Values => [qw/checkers chess cribbage/]), - qq(checkers ). - qq(chess ). - qq(cribbage), + qq( ), 'checkbox_group()'); is(checkbox_group(-name => 'game', '-values' => [qw/checkers chess cribbage/], - '-defaults' => ['cribbage'],-override=>1), - qq(checkers ). - qq(chess ). - qq(cribbage), + '-defaults' => ['cribbage'], + -override=>1), + qq( ), 'checkbox_group()'); is(popup_menu(-name => 'game', '-values' => [qw/checkers chess cribbage/], -default => 'cribbage', - -override => 1)."\n", - < - - - - -END - + -override => 1), + '', + 'popup_menu()');