Imported Upstream version 2.5.11
[libapache-mod-security.git] / apache2 / t / tfn / normalisePathWin.t
1 ### Empty
2 {
3         type => "tfn",
4         name => "normalisePathWin",
5         input => "",
6         output => "",
7         ret => 0,
8 },
9
10 ### Nothing but switch slashes
11 {
12         type => "tfn",
13         name => "normalisePathWin",
14         input => "\\foo\\bar\\baz",
15         output => "/foo/bar/baz",
16         ret => 1,
17 },
18 {
19         type => "tfn",
20         name => "normalisePathWin",
21         input => "\\foo\\bar\0\\baz",
22         output => "/foo/bar\0/baz",
23         ret => 1,
24 },
25
26 ### Basics
27 {
28         type => "tfn",
29         name => "normalisePathWin",
30         input => "\\foo\\bar\\\\baz",
31         output => "/foo/bar/baz",
32         ret => 1,
33 },
34 {
35         type => "tfn",
36         name => "normalisePathWin",
37         input => "\\foo\\bar baz\\.\\.\\.\\.\\boo\\\\eek\\.\\.\\..\\whoa",
38         output => "/foo/bar baz/boo/whoa",
39         ret => 1,
40 },
41 {
42         type => "tfn",
43         name => "normalisePathWin",
44         input => ".\\foo\\bar baz\\.\\.\\.\\.\\boo\\\\eek\\.\\.\\..\\whoa",
45         output => "./foo/bar baz/boo/whoa",
46         ret => 1,
47 },
48 {
49         type => "tfn",
50         name => "normalisePathWin",
51         input => "\\.\\foo\\bar baz\\.\\.\\.\\.\\boo\\\\eek\\.\\.\\..\\whoa",
52         output => "/foo/bar baz/boo/whoa",
53         ret => 1,
54 },
55 {
56         type => "tfn",
57         name => "normalisePathWin",
58         input => "\\\\foo\\bar baz\\.\\.\\.\\.\\boo\\\\eek\\.\\.\\..\\whoa",
59         output => "/foo/bar baz/boo/whoa",
60         ret => 1,
61 },
62 {
63         type => "tfn",
64         name => "normalisePathWin",
65         input => "\\\\foo\\bar baz\\.\\.\\.\\.\\boo\\\\eek\\.\\.\\..\\whoa\\.\\",
66         output => "/foo/bar baz/boo/whoa/",
67         ret => 1,
68 },
69 {
70         type => "tfn",
71         name => "normalisePathWin",
72         input => "\\.\\foo\\bar baz\\.\\.\\.\\.\\boo\\\\eek\\.\\.\\..\\whoa\\\\",
73         output => "/foo/bar baz/boo/whoa/",
74         ret => 1,
75 },
76 {
77         type => "tfn",
78         name => "normalisePathWin",
79         input => "\\.\\..\\..\\..\\..\\..\\..\\..\\..\\etc\\passwd",
80         output => "/etc/passwd",
81         ret => 1,
82 },
83 {
84         type => "tfn",
85         name => "normalisePathWin",
86         input => "\\.\\..\\.\\..\\..\\..\\..\\..\\..\\..\\etc\\..\\etc\\.\\passwd",
87         output => "/etc/passwd",
88         ret => 1,
89 },
90
91 ### With NUL
92 {
93         type => "tfn",
94         name => "normalisePathWin",
95         input => "\\.\\..\\.\\..\\..\\..\\..\\..\\..\\..\\\0\\..\\etc\\.\\passwd",
96         output => "/etc/passwd",
97         ret => 1,
98 },