]> Dogcows Code - chaz/p5-CGI-Ex/blob - t/2_fill_01_form.t
e6309e5a62d0a7e0468a19a6e94503180ede16e3
[chaz/p5-CGI-Ex] / t / 2_fill_01_form.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 = '
14 <INPUT TYPE="TEXT" NAME="foo1" value="nada">
15 <input type="hidden" name="foo2"/>
16 ';
17
18 my %fdat = (foo1 => 'bar1',
19 foo2 => '"bar2"');
20
21
22 my $fif = new CGI::Ex;
23 my $output = $fif->fill(scalarref => \$hidden_form_in,
24 fdat => \%fdat);
25 if ($output =~ m/^\s*<input( (type="TEXT"|name="foo1"|value="bar1")){3}>\s*<input( (type="hidden"|name="foo2"|value="&quot;bar2&quot;")){3}\s*\/>\s*$/i){
26 print "ok 2\n";
27 } else {
28 print "Got unexpected out for $hidden_form_in:\n$output\n";
29 print "not ok 2\n";
30 }
This page took 0.029273 seconds and 3 git commands to generate.