]> Dogcows Code - chaz/p5-CGI-Ex/blobdiff - t/2_fill_20_switcharoo.t
CGI::Ex 2.00
[chaz/p5-CGI-Ex] / t / 2_fill_20_switcharoo.t
index fac4441c894973b90319058a27fc79778d4d1d31..2ad1ae6f005948c7fbbf42eb7c7e8e3b55a557fc 100644 (file)
 # -*- Mode: Perl; -*-
 
+=head1 NAME
+
+2_fill_20_switcharoo.t - Test CGI::Ex::Fill's ability to handle many different types of broken html tags
+
+=cut
+
 use strict;
-$^W = 1;
-print "1..27\n";
-use CGI::Ex;
-print "ok 1\n";
+use Test::More tests => 27;
+
+use_ok('CGI::Ex::Fill');
 
 
 my $string;
 my %fdat = (foo1 => 'bar1');
-my $cgix = new CGI::Ex;
-my $n    = 1;
-my $dook = sub {
-  $n ++;
-  print "$n - ($string)\n";
+my $do_ok = sub {
   my @a;
-  if ($string =~ m/ value=([\"\'])bar1\1/i
-      && 1 == scalar(@a=$string =~ m/(value)/gi)) {
-    print "ok $n\n";
-  } else {
-    print "not ok $n\n";
-  }
+  ok($string =~ m/ value=([\"\'])bar1\1/i
+     && 1 == scalar(@a=$string =~ m/(value)/gi), "Should match ($string)");
 };
 
 ###----------------------------------------------------------------###
 
 $string = qq{<input name="foo1">};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<input name=foo1>};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<input name=foo1 />};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<input value name="foo1">};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<input value value name="foo1">};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<input value value="" name="foo1">};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<input grrr name="foo1" value="">};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<input value= name="foo1">};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<input type=hidden value= name="foo1">};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<input value= type="hidden" name="foo1">};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<input value="" name="foo1">};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<input value='' name="foo1">};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<input value='one' name="foo1">};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<input Value="one" name="foo1">};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<input VALUE="one" name="foo1">};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<input name="foo1" value="one">};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<INPUT NAME="foo1" VALUE="one">};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<INPUT NAME="foo1" VALUE="one" >};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<INPUT NAME="foo1" VALUE="" >};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<INPUT NAME="foo1" VALUE= >};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<INPUT NAME="foo1" VALUE >};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<INPUT NAME="foo1" VALUE />};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<INPUT NAME="foo1" VALUE= />};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<INPUT NAME="foo1" VALUE="" />};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<INPUT NAME="foo1" VALUE="one" />};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 $string = qq{<INPUT NAME="foo1" VALUE="one" />};
-$cgix->fill(text => \$string, form => \%fdat);
-&$dook();
+CGI::Ex::Fill::form_fill(\$string, \%fdat);
+$do_ok->();
 
 
This page took 0.024553 seconds and 4 git commands to generate.