Mercurial > hg > nginx-tests
comparison js.t @ 1315:890516ca898a
Tests: reverted 3882f8f3b2bc to unbreak with njs 0.1.15.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 02 Apr 2018 19:47:17 +0300 |
parents | 3882f8f3b2bc |
children | f48d2792730e |
comparison
equal
deleted
inserted
replaced
1314:b6d941ff65f4 | 1315:890516ca898a |
---|---|
176 function test_var(req, res) { | 176 function test_var(req, res) { |
177 return 'variable=' + req.variables.remote_addr; | 177 return 'variable=' + req.variables.remote_addr; |
178 } | 178 } |
179 | 179 |
180 function test_log(req, res) { | 180 function test_log(req, res) { |
181 req.log("SEE-THIS-LOG"); | 181 req.log("SEE-THIS"); |
182 req.warn("SEE-THIS-WARN"); | |
183 req.error("SEE-THIS-ERROR"); | |
184 } | 182 } |
185 | 183 |
186 function test_except(req, res) { | 184 function test_except(req, res) { |
187 var fs = require('fs'); | 185 var fs = require('fs'); |
188 fs.readFileSync(); | 186 fs.readFileSync(); |
261 JSON.parse({}.a.a); | 259 JSON.parse({}.a.a); |
262 } | 260 } |
263 | 261 |
264 EOF | 262 EOF |
265 | 263 |
266 $t->try_run('no njs available')->plan(24); | 264 $t->try_run('no njs available')->plan(22); |
267 | 265 |
268 ############################################################################### | 266 ############################################################################### |
269 | 267 |
270 like(http_get('/req_method'), qr/method=GET/, 'req.method'); | 268 like(http_get('/req_method'), qr/method=GET/, 'req.method'); |
271 like(http_get('/req_version'), qr/version=1.0/, 'req.httpVersion'); | 269 like(http_get('/req_version'), qr/version=1.0/, 'req.httpVersion'); |
302 | 300 |
303 } | 301 } |
304 | 302 |
305 $t->stop(); | 303 $t->stop(); |
306 | 304 |
307 ok(index($t->read_file('error.log'), 'SEE-THIS-LOG') > 0, 'log js'); | 305 ok(index($t->read_file('error.log'), 'SEE-THIS') > 0, 'log js'); |
308 ok(index($t->read_file('error.log'), 'SEE-THIS-WARN') > 0, 'warn js'); | |
309 ok(index($t->read_file('error.log'), 'SEE-THIS-ERROR') > 0, 'error js'); | |
310 ok(index($t->read_file('error.log'), 'at fs.readFileSync') > 0, | 306 ok(index($t->read_file('error.log'), 'at fs.readFileSync') > 0, |
311 'js_set backtrace'); | 307 'js_set backtrace'); |
312 ok(index($t->read_file('error.log'), 'at JSON.parse') > 0, | 308 ok(index($t->read_file('error.log'), 'at JSON.parse') > 0, |
313 'js_content backtrace'); | 309 'js_content backtrace'); |
314 | 310 |