X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-CGI-Ex;a=blobdiff_plain;f=t%2F2_fill_03_checkbox.t;h=c74d271a48aa7e490a02f2398dd2d847741ad852;hp=c3ba79280ee3fe9e8642a1b872c7faf9bf1f82ad;hb=4eee158dce82376f2f37de29d91c53f60a24aebe;hpb=85070b46d0a93ddbeef07341421adb8389a55418 diff --git a/t/2_fill_03_checkbox.t b/t/2_fill_03_checkbox.t index c3ba792..c74d271 100644 --- a/t/2_fill_03_checkbox.t +++ b/t/2_fill_03_checkbox.t @@ -1,14 +1,15 @@ # -*- Mode: Perl; -*- -use strict; +=head1 NAME -$^W = 1; +2_fill_03_checkbox.t - Test CGI::Ex::Fill's ability to fill checkboxes fields -print "1..2\n"; +=cut -use CGI::Ex; +use Test::More tests => 2; +use strict; -print "ok 1\n"; +use_ok('CGI::Ex::Fill'); my $hidden_form_in = qq{ @@ -35,15 +36,11 @@ my %fdat = (foo1 => 'bar1', foo7 => 'on', foo8 => ''); -my $fif = new CGI::Ex; -my $output = $fif->fill(scalarref => \$hidden_form_in, - fdat => \%fdat); +my $output = CGI::Ex::Fill::form_fill($hidden_form_in, + \%fdat); my $is_checked = join(" ",map { m/checked/i ? "yes" : "no" } split ("\n",$output)); -if ($is_checked eq "yes no no yes yes no no no no no yes no yes no yes no"){ - print "ok 2\n"; -} else { - print "Got unexpected is_checked for checkboxes:\n$is_checked\n"; - print "not ok 2\n"; -} +ok($is_checked eq "yes no no yes yes no no no no no yes no yes no yes no", + "Checkboxes should match ($is_checked)"); +