]> Dogcows Code - chaz/p5-CGI-Ex/blob - t/2_fill_10_escape.t
CGI::Ex 2.00
[chaz/p5-CGI-Ex] / t / 2_fill_10_escape.t
1 # -*- Mode: Perl; -*-
2
3 =head1 NAME
4
5 2_fill_10_escape.t - Make sure CGI::Ex::Fill works with escaped values.
6
7 =cut
8
9 use strict;
10 use Test::More tests => 2;
11
12 use_ok('CGI::Ex::Fill');
13
14 my $html =<<"__HTML__";
15 <HTML>
16 <BODY>
17 <FORM action="test.cgi" method="POST">
18 <INPUT type="hidden" name="hidden" value="&gt;&quot;">
19 <INPUT type="text" name="text" value="&lt;&gt;&quot;&otilde;"><BR>
20 <INPUT type="radio" name="radio" value="&quot;&lt;&gt;">test<BR>
21 <INPUT type="checkbox" name="checkbox" value="&quot;&lt;&gt;">test<BR>
22 <INPUT type="checkbox" name="checkbox" value="&quot;&gt;&lt;&gt;">test<BR>
23 <SELECT name="select">
24 <OPTION value="&lt;&gt;">&lt;&gt;
25 <OPTION value="&gt;&gt;">&gt;&gt;
26 <OPTION value="&otilde;">&lt;&lt;
27 <OPTION>&gt;&gt;&gt;
28 </SELECT><BR>
29 <TEXTAREA name="textarea" rows="5">&lt;&gt;&quot;</TEXTAREA><P>
30 <INPUT type="submit" value=" OK ">
31 </FORM>
32 </BODY>
33 </HTML>
34 __HTML__
35
36 my %fdat = ();
37
38 my $output = CGI::Ex::Fill::form_fill($html,
39 \%fdat);
40
41 # FIF changes order of HTML attributes, so split strings and sort
42 my $strings_output = join("\n", sort split(/[\s><]+/, lc($output)));
43 my $strings_html = join("\n", sort split(/[\s><]+/, lc($html)));
44
45 ok($strings_output eq $strings_html,
46 "Strings matched");
This page took 0.032092 seconds and 4 git commands to generate.