Imported Upstream version 2.5.11
[libapache-mod-security.git] / apache2 / t / tfn / htmlEntityDecode.t
1 ### Empty
2 {
3         type => "tfn",
4         name => "htmlEntityDecode",
5         input => "",
6         output => "",
7         ret => 0,
8 },
9
10 ### Nothing
11 {
12         type => "tfn",
13         name => "htmlEntityDecode",
14         input => "TestCase",
15         output => "TestCase",
16         ret => 0,
17 },
18 {
19         type => "tfn",
20         name => "htmlEntityDecode",
21         input => "Test\0Case",
22         output => "Test\0Case",
23         ret => 0,
24 },
25
26 ### Valid
27 # With ;
28 {
29         type => "tfn",
30         name => "htmlEntityDecode",
31         input => "��  � \0d"&<> ",
32         output => "\0\0\x20\x20\0\x20\0\x64\"&<>\xa0",
33         ret => 1,
34 },
35 # Without ;
36 {
37         type => "tfn",
38         name => "htmlEntityDecode",
39         input => "&#x0&#X0&#x20&#X20&#0&#32\0&#100&quot&amp&lt&gt&nbsp",
40         output => "\0\0\x20\x20\0\x20\0\x64\"&<>\xa0",
41         ret => 1,
42 },
43
44 ### Invalid
45 {
46         type => "tfn",
47         name => "htmlEntityDecode",
48         input => "&#xg;&#Xg;&#xg0;&#X2g;&#a;\0&#a2;&#3a&#a00;&#1a0;&#10a;&foo;",
49         output => "&#xg;&#Xg;&#xg0;\x02g;&#a;\0&#a2;\x03a&#a00;\x01a0;\x0aa;&foo;",
50         ret => 1,
51 },
52 {
53         type => "tfn",
54         name => "htmlEntityDecode",
55         input => "&#xg&#Xg&#xg0&#X2g&#a\0&#a2&#3a&#a00&#1a0&#10a&foo",
56         output => "&#xg&#Xg&#xg0\x02g&#a\0&#a2\x03a&#a00\x01a0\x0aa&foo",
57         ret => 1,
58 },