Mercurial > hg > nginx-tests
changeset 502:134ea15d7473
Tests: SSI test with "postpone_output 0" (ticket #132).
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 27 Nov 2014 07:00:10 +0300 |
parents | 0ee2899fbe3e |
children | 071e8941e3bf |
files | ssi.t |
diffstat | 1 files changed, 22 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ssi.t Mon Nov 24 17:01:25 2014 +0300 +++ b/ssi.t Thu Nov 27 07:00:10 2014 +0300 @@ -23,7 +23,7 @@ plan(skip_all => 'win32') if $^O eq 'MSWin32'; -my $t = Test::Nginx->new()->has(qw/http ssi cache proxy rewrite/)->plan(27); +my $t = Test::Nginx->new()->has(qw/http ssi cache proxy rewrite/)->plan(28); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -64,6 +64,10 @@ ssi off; alias %%TESTDIR%%/; } + location = /test-empty-postpone.html { + ssi on; + postpone_output 0; + } location /var { ssi on; add_header X-Var $date_gmt; @@ -94,6 +98,8 @@ 'X<!--#include virtual="/local/empty.html" -->X'); $t->write_file('test-empty3.html', 'X<!--#include virtual="/cache/empty.html" -->X'); +$t->write_file('test-empty-postpone.html', + 'X<!--#include virtual="/proxy/empty.html" -->X'); $t->write_file('empty.html', ''); $t->write_file('unescape.html?', 'SEE-THIS'); @@ -146,11 +152,21 @@ unlike(http_get('/proxy/test1.html'), qr/Last-Modified|Accept-Ranges/im, 'cleared headers from proxy'); +# empty subrequests + like(http_get('/test-empty1.html'), qr/HTTP/, 'empty with ssi'); like(http_get('/test-empty2.html'), qr/HTTP/, 'empty without ssi'); like(http_get('/test-empty3.html'), qr/HTTP/, 'empty with proxy'); like(http_get('/test-empty3.html'), qr/HTTP/, 'empty with proxy cached'); +TODO: { +local $TODO = 'not yet'; + +like(http_get('/test-empty-postpone.html'), qr/HTTP.*XX/ms, + 'empty with postpone_output 0'); + +} + # handling of escaped URIs like(http_get('/unescape1.html'), qr/^XXtestXX$/m, 'escaped in path'); @@ -176,6 +192,11 @@ like(http_get('/var_format.html'), qr/x\w+, \d\d-\w{3}-\d{4} \d\d:\d\d:\d\d \w+x/, 'default ssi'); +TODO: { +local $TODO = 'not yet'; + like(`grep -F '[alert]' ${\($t->testdir())}/error.log`, qr/^$/s, 'no alerts'); +} + ###############################################################################