5 2_fill_16_ignore_fields.t - Test CGI::Ex::Fill's ability to fill ignore some fields
10 use Test::More tests => 2;
12 use_ok('CGI::Ex::Fill');
14 my $hidden_form_in = qq{<select multiple name="foo1">
15 <option value="0">bar1</option>
16 <option value="bar2">bar2</option>
17 <option value="bar3">bar3</option>
19 <select multiple name="foo2">
20 <option value="bar1">bar1</option>
21 <option value="bar2">bar2</option>
22 <option value="bar3">bar3</option>
24 <select multiple name="foo3">
25 <option value="bar1">bar1</option>
26 <option selected value="bar2">bar2</option>
27 <option value="bar3">bar3</option>
29 <select multiple name="foo4">
30 <option value="bar1">bar1</option>
31 <option selected value="bar2">bar2</option>
32 <option value="bar3">bar3</option>
36 foo2 => ['bar1', 'bar2',],
40 my $output = CGI::Ex::Fill::form_fill($hidden_form_in, $q, undef, undef, ['asdf','foo1','asdf']);
42 my $is_selected = join(" ",map { m/selected/ ? "yes" : "no" } grep /option/, split ("\n",$output));
44 ok($is_selected eq "no no no yes yes no no no no no yes no",
45 "Should match ($is_selected)");