]> Dogcows Code - chaz/p5-CGI-Ex/blobdiff - t/2_fill_01_form.t
CGI::Ex 2.00
[chaz/p5-CGI-Ex] / t / 2_fill_01_form.t
index e6309e5a62d0a7e0468a19a6e94503180ede16e3..806b75493729193fa59b0a5dfefe45784ea2ac49 100644 (file)
@@ -1,14 +1,15 @@
 # -*- Mode: Perl; -*-
 
-use strict;
+=head1 NAME
 
-$^W = 1;
+2_fill_01_form.t - Test CGI::Ex::Fill's ability to fill hidden fields
 
-print "1..2\n";
+=cut
 
-use CGI::Ex;
+use strict;
+use Test::More tests => 2;
 
-print "ok 1\n";
+use_ok('CGI::Ex::Fill');
 
 my $hidden_form_in = '
 <INPUT TYPE="TEXT" NAME="foo1" value="nada">
@@ -19,12 +20,7 @@ my %fdat = (foo1 => 'bar1',
             foo2 => '"bar2"');
 
 
-my $fif = new CGI::Ex;
-my $output = $fif->fill(scalarref => \$hidden_form_in,
-                       fdat      => \%fdat);
-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){
-       print "ok 2\n";
-} else {
-       print "Got unexpected out for $hidden_form_in:\n$output\n";
-       print "not ok 2\n";
-}
+my $output = CGI::Ex::Fill::form_fill($hidden_form_in,
+                                      \%fdat);
+ok($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,
+   "Basic case insensitive match worked ($output)");
This page took 0.017148 seconds and 4 git commands to generate.