5 2_fill_12_mult.t - Test CGI::Ex::Fill's ability to fill multiple instances of the same field name
10 use Test::More tests => 4;
12 use_ok('CGI::Ex::Fill');
14 my $hidden_form_in = qq{<INPUT TYPE="TEXT" NAME="foo1" value="cat1">
15 <input type="text" name="foo1" value="cat2"/>};
17 my %fdat = (foo1 => ['bar1','bar2']);
19 my $output = CGI::Ex::Fill::form_fill($hidden_form_in,
21 ok($output =~ m/^<input( (type="TEXT"|name="foo1"|value="bar1")){3}>\s*<input( (type="text"|name="foo1"|value="bar2")){3}\s*\/>$/i,
22 "Should match ($output)");
25 %fdat = (foo1 => ['bar1']);
27 $output = CGI::Ex::Fill::form_fill($hidden_form_in,
29 ok($output =~ m/^<input( (type="TEXT"|name="foo1"|value="bar1")){3}>\s*<input( (type="text"|name="foo1"|value="")){3}\s*\/>$/i,
30 "Should match ($output)");
32 %fdat = (foo1 => 'bar1');
34 $output = CGI::Ex::Fill::form_fill($hidden_form_in,
36 ok($output =~ m/^<input( (type="TEXT"|name="foo1"|value="bar1")){3}>\s*<input( (type="text"|name="foo1"|value="bar1")){3}\s*\/>$/i,
37 "Should match ($output)");