]> Dogcows Code - chaz/p5-CGI-Ex/blob - t/2_fill_17_xhtml.t
CGI::Ex 2.00
[chaz/p5-CGI-Ex] / t / 2_fill_17_xhtml.t
1 # -*- Mode: Perl; -*-
2
3 =head1 NAME
4
5 2_fill_17_xhtml.t - Test CGI::Ex::Fill's ability to play nice with XHTML
6
7 =cut
8
9 use strict;
10 use Test::More tests => 2;
11
12 use_ok('CGI::Ex::Fill');
13
14 my $html = <<EOF;
15 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
16 "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
17 <html>
18 <body>
19 <input type="radio" name="status" value=0 />Canceled<br>
20 <input type="radio" name="status" value=1 />Confirmed<br>
21 <input type="radio" name="status" value=2 />Wait List<br>
22
23 <input type="radio" name="status" value=3 />No Show<br>
24 <input type="radio" name="status" value=4 />Moved to Another Class<br>
25 <input type="radio" name="status" value=5 />Late Cancel<br>
26 </body>
27 </html>
28 EOF
29
30 my $q = {
31 status => 1,
32 };
33
34 my $output = CGI::Ex::Fill::form_fill($html, $q);
35
36 my $matches;
37 while ($output =~ m!( />)!g) {
38 $matches++;
39 }
40
41 ok($matches == 6,
42 "Had correct matches ($output)");
This page took 0.028712 seconds and 4 git commands to generate.