Mercurial > hg > nginx-tests
changeset 1438:98facc98bb2e
Tests: adapted js.t to set header changes in njs.
Empty value means no header.
author | Dmitry Volyntsev <xeioex@nginx.com> |
---|---|
date | Wed, 06 Feb 2019 20:19:00 +0300 |
parents | 2fc21bdd6f0d |
children | c083749bc47d |
files | js.t |
diffstat | 1 files changed, 10 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/js.t Wed Feb 06 12:17:04 2019 +0300 +++ b/js.t Wed Feb 06 20:19:00 2019 +0300 @@ -328,9 +328,6 @@ ############################################################################### -TODO: { -local $TODO = 'not yet' - unless http_get('/njs') =~ /^([.0-9]+)$/m && $1 ge '0.2.2'; like(http_get('/method'), qr/method=GET/, 'r.method'); like(http_get('/version'), qr/version=1.0/, 'r.httpVersion'); @@ -347,12 +344,19 @@ like(http_get('/clen'), qr/Content-Length: 5/, 'r.headersOut.contentLength'); like(http_get('/hdr_out?foo=12345'), qr/Foo: 12345/, 'r.headersOut'); like(http_get('/hdr_out?foo=123&bar=copy'), qr/Bar: 123/, 'r.headersOut get'); -like(http_get('/hdr_out?bar=empty'), qr/Bar: \x0d/, 'r.headersOut empty'); -like(http_get('/hdr_out?foo='), qr/Foo: \x0d/, 'r.headersOut no value'); -like(http_get('/hdr_out?foo'), qr/Foo: \x0d/, 'r.headersOut no value 2'); like(http_get('/ihdr_out?a=12&b=34'), qr/^1234$/m, 'r.headersOut iteration'); like(http_get('/ihdr_out'), qr/\x0d\x0a?\x0d\x0a?$/m, 'r.send zero'); +TODO: { +local $TODO = 'not yet' + unless http_get('/njs') =~ /^([.0-9]+)$/m && $1 ge '0.2.8'; + +unlike(http_get('/hdr_out?bar=empty'), qr/Bar:/, 'r.headersOut empty'); +unlike(http_get('/hdr_out?foo='), qr/Foo:/, 'r.headersOut no value'); +unlike(http_get('/hdr_out?foo'), qr/Foo:/, 'r.headersOut no value 2'); + +} + like(http_post('/body'), qr/REQ-BODY/, 'request body'); like(http_post('/in_file'), qr/request body is in a file/, 'request body in file'); @@ -382,7 +386,6 @@ like(http_get('/content_empty'), qr/500 Internal Server Error/, 'empty handler'); -} $t->stop();