]> Dogcows Code - chaz/p5-CGI-Ex/blobdiff - t/2_fill_17_xhtml.t
CGI::Ex 2.00
[chaz/p5-CGI-Ex] / t / 2_fill_17_xhtml.t
index 5fde93b58f6d3b1e6063f340e6bef9fcc35e071c..4e4b105d6f280f14940302132629e6db5a165f7f 100644 (file)
@@ -1,13 +1,15 @@
 # -*- Mode: Perl; -*-
 
-use strict;
+=head1 NAME
+
+2_fill_17_xhtml.t - Test CGI::Ex::Fill's ability to play nice with XHTML
 
-$^W = 1;
+=cut
 
-print "1..1\n";
+use strict;
+use Test::More tests => 2;
 
-use CGI::Ex;
-use CGI;
+use_ok('CGI::Ex::Fill');
 
 my $html = <<EOF;
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
@@ -25,25 +27,16 @@ my $html = <<EOF;
 </html>
 EOF
 
-my $q = CGI->new;
-$q->param('status', 1 );
+my $q = {
+    status => 1,
+};
 
-my $fif = CGI::Ex->new;
-
-my $output = $fif->fill(
-    scalarref => \$html,
-    fobject => $q
-);
+my $output = CGI::Ex::Fill::form_fill($html, $q);
 
 my $matches;
 while ($output =~ m!( />)!g) {
   $matches++;
 }
 
-if ($matches == 6) {
-  print "ok 1\n";
-} else {
-  print "not ok 1\n";
-}
-
-print $output;
+ok($matches == 6,
+   "Had correct matches ($output)");
This page took 0.018547 seconds and 4 git commands to generate.