# -*- 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">
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)");
+