Mercurial > hg > nginx-tests
comparison autoindex.t @ 126:0a2f750790c9
Tests: add autoindex test for '?' in file name.
Reported by: Konstantin Leonov
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 04 Feb 2010 13:34:34 +0300 |
parents | f10f077a3174 |
children | afa07ae9def6 |
comparison
equal
deleted
inserted
replaced
125:f10f077a3174 | 126:0a2f750790c9 |
---|---|
19 ############################################################################### | 19 ############################################################################### |
20 | 20 |
21 select STDERR; $| = 1; | 21 select STDERR; $| = 1; |
22 select STDOUT; $| = 1; | 22 select STDOUT; $| = 1; |
23 | 23 |
24 my $t = Test::Nginx->new()->has(qw/http autoindex/)->plan(15) | 24 my $t = Test::Nginx->new()->has(qw/http autoindex/)->plan(16) |
25 ->write_file_expand('nginx.conf', <<'EOF'); | 25 ->write_file_expand('nginx.conf', <<'EOF'); |
26 | 26 |
27 %%TEST_GLOBALS%% | 27 %%TEST_GLOBALS%% |
28 | 28 |
29 master_process off; | 29 master_process off; |
61 | 61 |
62 $t->write_file('test-colon:blah', ''); | 62 $t->write_file('test-colon:blah', ''); |
63 $t->write_file('test-long-' . ('0' x 50), ''); | 63 $t->write_file('test-long-' . ('0' x 50), ''); |
64 $t->write_file('test-long-' . ('>' x 50), ''); | 64 $t->write_file('test-long-' . ('>' x 50), ''); |
65 $t->write_file('test-escape-url-%', ''); | 65 $t->write_file('test-escape-url-%', ''); |
66 $t->write_file('test-escape-url2-?', ''); | |
66 $t->write_file('test-escape-html-<>&', ''); | 67 $t->write_file('test-escape-html-<>&', ''); |
67 | 68 |
68 mkdir($d . '/utf8'); | 69 mkdir($d . '/utf8'); |
69 $t->write_file('utf8/test-utf8-' . ("\xd1\x84" x 3), ''); | 70 $t->write_file('utf8/test-utf8-' . ("\xd1\x84" x 3), ''); |
70 $t->write_file('utf8/test-utf8-' . ("\xd1\x84" x 45), ''); | 71 $t->write_file('utf8/test-utf8-' . ("\xd1\x84" x 45), ''); |
89 like($r, qr!test-long-0{37}\.\.>!ms, 'long name'); | 90 like($r, qr!test-long-0{37}\.\.>!ms, 'long name'); |
90 | 91 |
91 like($r, qr!href="test-escape-url-%25"!ms, 'escaped url'); | 92 like($r, qr!href="test-escape-url-%25"!ms, 'escaped url'); |
92 | 93 |
93 { | 94 { |
95 local $TODO = 'not fixed yet'; | |
96 | |
97 like($r, qr!href="test-escape-url2-%3f"!ms, 'escaped ? in url'); | |
98 | |
99 } | |
100 | |
101 { | |
94 local $TODO = 'patch under review'; | 102 local $TODO = 'patch under review'; |
95 | 103 |
96 like($r, qr!test-escape-html-<>&!ms, 'escaped html'); | 104 like($r, qr!test-escape-html-<>&!ms, 'escaped html'); |
97 like($r, qr!test-long-(>){37}\.\.>!ms, 'long escaped html'); | 105 like($r, qr!test-long-(>){37}\.\.>!ms, 'long escaped html'); |
98 | 106 |