Mercurial > hg > nginx-tests
comparison ssi.t @ 102:9f723d3ba52d
Tests: tests for empty static subrequests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 02 Oct 2009 18:19:43 +0400 |
parents | b8b901f86518 |
children | bb5b5e69b45e |
comparison
equal
deleted
inserted
replaced
101:6303927c18d2 | 102:9f723d3ba52d |
---|---|
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()->plan(11); | 24 my $t = Test::Nginx->new()->plan(13); |
25 | 25 |
26 $t->write_file_expand('nginx.conf', <<'EOF'); | 26 $t->write_file_expand('nginx.conf', <<'EOF'); |
27 | 27 |
28 master_process off; | 28 master_process off; |
29 daemon off; | 29 daemon off; |
61 $t->write_file('test1.html', 'X<!--#echo var="arg_test" -->X'); | 61 $t->write_file('test1.html', 'X<!--#echo var="arg_test" -->X'); |
62 $t->write_file('test2.html', | 62 $t->write_file('test2.html', |
63 'X<!--#include virtual="/test1.html?test=test" -->X'); | 63 'X<!--#include virtual="/test1.html?test=test" -->X'); |
64 $t->write_file('test3.html', | 64 $t->write_file('test3.html', |
65 'X<!--#set var="blah" value="test" --><!--#echo var="blah" -->X'); | 65 'X<!--#set var="blah" value="test" --><!--#echo var="blah" -->X'); |
66 $t->write_file('test-empty1.html', 'X<!--#include virtual="/empty.html" -->X'); | |
67 $t->write_file('test-empty2.html', | |
68 'X<!--#include virtual="/local/empty.html" -->X'); | |
69 $t->write_file('empty.html', ''); | |
66 | 70 |
67 $t->run(); | 71 $t->run(); |
68 | 72 |
69 ############################################################################### | 73 ############################################################################### |
70 | 74 |
86 unlike(http_get('/test1.html'), qr/Last-Modified|Accept-Ranges/im, | 90 unlike(http_get('/test1.html'), qr/Last-Modified|Accept-Ranges/im, |
87 'cleared headers'); | 91 'cleared headers'); |
88 unlike(http_get('/proxy/test1.html'), qr/Last-Modified|Accept-Ranges/im, | 92 unlike(http_get('/proxy/test1.html'), qr/Last-Modified|Accept-Ranges/im, |
89 'cleared headers from proxy'); | 93 'cleared headers from proxy'); |
90 | 94 |
95 like(http_get('/test-empty1.html'), qr/HTTP/, 'empty with ssi'); | |
96 like(http_get('/test-empty2.html'), qr/HTTP/, 'empty without ssi'); | |
97 | |
91 ############################################################################### | 98 ############################################################################### |