Mercurial > hg > nginx-tests
diff ssi.t @ 574:2cd00179f4b2
Tests: has_feature() introduced in Test::Nginx.
It is used to check in a platform-aware way for a non-standard capability.
Use it for shared memory ('shmem') and symlink. Notably, this enables
corresponding tests on win32 where/when appropriate.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 14 May 2015 14:46:13 +0300 |
parents | 517cde5075d8 |
children | 6c0a5903d0ae |
line wrap: on
line diff
--- a/ssi.t +++ b/ssi.t @@ -21,9 +21,8 @@ use Test::Nginx; select STDERR; $| = 1; select STDOUT; $| = 1; -plan(skip_all => 'win32') if $^O eq 'MSWin32'; - -my $t = Test::Nginx->new()->has(qw/http ssi cache proxy rewrite/)->plan(28); +my $t = Test::Nginx->new()->has(qw/http ssi cache proxy rewrite shmem/) + ->plan(28); $t->write_file_expand('nginx.conf', <<'EOF'); @@ -102,7 +101,7 @@ EOF 'X<!--#include virtual="/proxy/empty.html" -->X'); $t->write_file('empty.html', ''); -$t->write_file('unescape.html?', 'SEE-THIS'); +$t->write_file('unescape.html?', 'SEE-THIS') unless $^O eq 'MSWin32'; $t->write_file('unescape1.html', 'X<!--#include virtual="/tes%741.html?test=test" -->X'); $t->write_file('unescape2.html', @@ -165,11 +164,17 @@ like(http_get('/test-empty-postpone.html # handling of escaped URIs like(http_get('/unescape1.html'), qr/^XXtestXX$/m, 'escaped in path'); + +SKIP: { +skip 'incorrect filename on win32', 2 if $^O eq 'MSWin32'; + like(http_get('/unescape2.html'), qr/^XSEE-THISX$/m, 'escaped question in path'); like(http_get('/unescape3.html'), qr/404 Not Found/, 'escaped query separator'); +} + # handling of embedded date variables my $re_date_gmt = qr/X-Var: x\w+, \d\d-\w{3}-\d{4} \d\d:\d\d:\d\d [\w ]+x/;