]> Dogcows Code - chaz/p5-CGI-Ex/blobdiff - t/2_fill_05_textarea.t
CGI::Ex 2.00
[chaz/p5-CGI-Ex] / t / 2_fill_05_textarea.t
index 9aa7e592fc79aa798e6c9f07c1c5fedfdd754106..5c1e2dbfb50712a5d1b44078c7a37099c8d6379b 100644 (file)
@@ -1,39 +1,30 @@
 # -*- Mode: Perl; -*-
 
-use strict;
+=head1 NAME
 
-$^W = 1;
+2_fill_05_textarea.t - Test CGI::Ex::Fill's ability to fill textarea fields
 
-print "1..3\n";
+=cut
 
-use CGI::Ex;
+use strict;
+use Test::More tests => 3;
 
-print "ok 1\n";
+use_ok('CGI::Ex::Fill');
 
 my $hidden_form_in = qq{<TEXTAREA NAME="foo">blah</TEXTAREA>};
 
 my %fdat = (foo => 'bar>bar');
 
-my $fif = new CGI::Ex;
-my $output = $fif->fill(scalarref => \$hidden_form_in,
-                       fdat => \%fdat);
-if ($output eq '<TEXTAREA NAME="foo">bar&gt;bar</TEXTAREA>'){
-       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 eq '<TEXTAREA NAME="foo">bar&gt;bar</TEXTAREA>',
+   "Output should match ($output)");
 
 # empty fdat test
 
 %fdat = (foo => '');
 
-$fif = new CGI::Ex;
-$output = $fif->fill(scalarref => \$hidden_form_in,
-                       fdat => \%fdat);
-if ($output eq '<TEXTAREA NAME="foo"></TEXTAREA>'){
-       print "ok 3\n";
-} else {
-       print "Got unexpected out for $hidden_form_in:\n$output\n";
-       print "not ok 3\n";
-}
+$output = CGI::Ex::Fill::form_fill($hidden_form_in,
+                                   \%fdat);
+ok($output eq '<TEXTAREA NAME="foo"></TEXTAREA>',
+   "Output should match ($output)");
This page took 0.018185 seconds and 4 git commands to generate.