]> Dogcows Code - chaz/p5-CGI-Ex/blobdiff - t/2_fill_06_radio.t
CGI::Ex 2.00
[chaz/p5-CGI-Ex] / t / 2_fill_06_radio.t
index 53ba4ad9d1cce014ca8fcc346cab886aae1f2e09..3ae260a2edabdb11e9d59ba6a0b09e4cd116ecd2 100644 (file)
@@ -1,14 +1,15 @@
 # -*- Mode: Perl; -*-
 
-use strict;
+=head1 NAME
 
-$^W = 1;
+2_fill_06_radio.t - Test CGI::Ex::Fill's ability to fill radio fields
 
-print "1..2\n";
+=cut
 
-use CGI::Ex;
+use strict;
+use Test::More tests => 2;
 
-print "ok 1\n";
+use_ok('CGI::Ex::Fill');
 
 my $hidden_form_in = qq{<INPUT TYPE="radio" NAME="foo1" value="bar1">
 <input type="radio" name="foo1" value="bar2">
@@ -17,13 +18,8 @@ my $hidden_form_in = qq{<INPUT TYPE="radio" NAME="foo1" value="bar1">
 
 my %fdat = (foo1 => 'bar2');
 
-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/ ? "yes" : "no" } split ("\n",$output));
-if ($is_checked eq 'no yes no no'){
-       print "ok 2\n";
-} else {
-       print "Got unexpected is_checked:\n$is_checked\n";
-       print "not ok 2\n";
-}
+ok($is_checked eq 'no yes no no',
+   "Should match ($is_checked)");
This page took 0.017225 seconds and 4 git commands to generate.