]> Dogcows Code - chaz/p5-CGI-Ex/blob - t/2_fill_12_mult.t
91755f5665de96ee81e45a94f5226ff432b7c21a
[chaz/p5-CGI-Ex] / t / 2_fill_12_mult.t
1 # -*- Mode: Perl; -*-
2
3 use strict;
4
5 $^W = 1;
6
7 print "1..3\n";
8
9 use CGI::Ex;
10
11 print "ok 1\n";
12
13 my $hidden_form_in = qq{<INPUT TYPE="TEXT" NAME="foo1" value="cat1">
14 <input type="text" name="foo1" value="cat2"/>};
15
16 my %fdat = (foo1 => ['bar1','bar2']);
17
18 my $fif = new CGI::Ex;
19 my $output = $fif->fill(scalarref => \$hidden_form_in,
20 fdat => \%fdat);
21 if ($output =~ m/^<input( (type="TEXT"|name="foo1"|value="bar1")){3}>\s*<input( (type="text"|name="foo1"|value="bar2")){3}\s*\/>$/i){
22 print "ok 2\n";
23 } else {
24 print "Got unexpected out for $hidden_form_in:\n$output\n";
25 print "not ok 2\n";
26 }
27
28 %fdat = (foo1 => ['bar1']);
29
30 $output = $fif->fill(scalarref => \$hidden_form_in,
31 fdat => \%fdat);
32 if ($output =~ m/^<input( (type="TEXT"|name="foo1"|value="bar1")){3}>\s*<input( (type="text"|name="foo1"|value="")){3}\s*\/>$/i){
33 print "ok 3\n";
34 } else {
35 print "Got unexpected out for $hidden_form_in:\n$output\n";
36 print "not ok 3\n";
37 }
This page took 0.030652 seconds and 3 git commands to generate.