Mercurial > hg > nginx-tests
changeset 1626:a35445ae8de7
Tests: adapted js buffer tests to renaming vars to rawVariables.
author | Dmitry Volyntsev <xeioex@nginx.com> |
---|---|
date | Thu, 26 Nov 2020 11:29:53 +0000 |
parents | a140cab489e8 |
children | 456bf219d768 |
files | js.t js_buffer.t stream_js_buffer.t |
diffstat | 3 files changed, 8 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/js.t Wed Nov 25 12:25:24 2020 +0000 +++ b/js.t Thu Nov 26 11:29:53 2020 +0000 @@ -307,8 +307,8 @@ like(http_get('/type?path=variables.host'), qr/200 OK.*type: string$/s, 'variables type'); -like(http_get('/type?path=vars.host'), qr/200 OK.*type: buffer$/s, - 'vars type'); +like(http_get('/type?path=rawVariables.host'), qr/200 OK.*type: buffer$/s, + 'rawVariables type'); like(http_post('/type?path=requestBody'), qr/200 OK.*type: string$/s, 'requestBody type');
--- a/js_buffer.t Wed Nov 25 12:25:24 2020 +0000 +++ b/js_buffer.t Thu Nov 26 11:29:53 2020 +0000 @@ -112,12 +112,13 @@ } function binary_var(r) { - var test = r.vars.binary_remote_addr.equals(Buffer.from([127,0,0,1])); + var test = r.rawVariables.binary_remote_addr + .equals(Buffer.from([127,0,0,1])); r.return(200, test); } export default {njs: test_njs, return: test_return, req_body, res_body, - binary_var}; + binary_var}; EOF
--- a/stream_js_buffer.t Wed Nov 25 12:25:24 2020 +0000 +++ b/stream_js_buffer.t Thu Nov 26 11:29:53 2020 +0000 @@ -99,13 +99,14 @@ } function type(s) { - var v = s.vars.remote_addr; + var v = s.rawVariables.remote_addr; var type = Buffer.isBuffer(v) ? 'buffer' : (typeof v); return type; } function binary_var(s) { - var test = s.vars.binary_remote_addr.equals(Buffer.from([127,0,0,1])); + var test = s.rawVariables + .binary_remote_addr.equals(Buffer.from([127,0,0,1])); return test; }