Imported Upstream version 2.5.11
[libapache-mod-security.git] / apache2 / t / tfn / cssDecode.t
1 ### Empty
2 {
3         type => "tfn",
4         name => "cssDecode",
5         input => "",
6         output => "",
7         ret => 0,
8 },
9
10 ### Nothing
11 {
12         type => "tfn",
13         name => "cssDecode",
14         input => "TestCase",
15         output => "TestCase",
16         ret => 0,
17 },
18 {
19         type => "tfn",
20         name => "cssDecode",
21         input => "Test\0Case",
22         output => "Test\0Case",
23         ret => 0,
24 },
25
26 ### Valid Sequences
27 {
28         type => "tfn",
29         name => "cssDecode",
30         input => "test\\a\\b\\f\\n\\r\\t\\v\\?\\'\\\"\\0\\12\\123\\1234\\12345\\123456\\ff01\\ff5e\\\n\\0  string",
31         output => qq(test\x0a\x0b\x0fnrtv?'"\x00\x12\x23\x34\x45\x56\x21\x7e\x00 string),
32         ret => 1,
33 },
34
35 ### Invalid Sequences
36 # Trailing escape == line continuation with no line following (ie nothing)
37 {
38         type => "tfn",
39         name => "cssDecode",
40         input => "test\\",
41         output => "test",
42         ret => 1,
43 },
44
45 # Edge cases
46 #  "\1A" == "\x1A"
47 #  "\1 A" == "\x01A"
48 #  "\1234567" == "\x567"
49 #  "\123456 7" == "\x567"
50 #  "\1x" == "\x01x"
51 #  "\1 x" == "\x01 x"
52 {
53         type => "tfn",
54         name => "cssDecode",
55         input => "\\1A\\1 A\\1234567\\123456 7\\1x\\1 x",
56         output => "\x1A\x01A\x567\x567\x01x\x01x",
57         ret => 1,
58 },