]> Dogcows Code - chaz/p5-CGI-Ex/blob - t/2_fill_06_radio.t
53ba4ad9d1cce014ca8fcc346cab886aae1f2e09
[chaz/p5-CGI-Ex] / t / 2_fill_06_radio.t
1 # -*- Mode: Perl; -*-
2
3 use strict;
4
5 $^W = 1;
6
7 print "1..2\n";
8
9 use CGI::Ex;
10
11 print "ok 1\n";
12
13 my $hidden_form_in = qq{<INPUT TYPE="radio" NAME="foo1" value="bar1">
14 <input type="radio" name="foo1" value="bar2">
15 <input type="radio" name="foo1" value="bar3">
16 <input type="radio" name="foo1" checked value="bar4">};
17
18 my %fdat = (foo1 => 'bar2');
19
20 my $fif = new CGI::Ex;
21 my $output = $fif->fill(scalarref => \$hidden_form_in,
22 fdat => \%fdat);
23 my $is_checked = join(" ",map { m/checked/ ? "yes" : "no" } split ("\n",$output));
24 if ($is_checked eq 'no yes no no'){
25 print "ok 2\n";
26 } else {
27 print "Got unexpected is_checked:\n$is_checked\n";
28 print "not ok 2\n";
29 }
This page took 0.030188 seconds and 3 git commands to generate.