]> Dogcows Code - chaz/p5-CGI-Ex/blobdiff - t/2_fill_03_checkbox.t
CGI::Ex 2.00
[chaz/p5-CGI-Ex] / t / 2_fill_03_checkbox.t
index c3ba79280ee3fe9e8642a1b872c7faf9bf1f82ad..c74d271a48aa7e490a02f2398dd2d847741ad852 100644 (file)
@@ -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{<input type="checkbox" name="foo1" value="bar1">
 <input type="checkbox" name="foo1" value="bar2">
@@ -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)");
+
This page took 0.017463 seconds and 4 git commands to generate.