Mercurial > hg > nginx-tests
comparison js.t @ 1455:558d3d9a000c
Tests: adapted js.t to njs changes.
author | Dmitry Volyntsev <xeioex@nginx.com> |
---|---|
date | Tue, 26 Mar 2019 15:43:10 +0300 |
parents | 5d0eb718f38e |
children | 9521130f6f22 |
comparison
equal
deleted
inserted
replaced
1454:3008cc57b5c9 | 1455:558d3d9a000c |
---|---|
230 function content_empty(r) { | 230 function content_empty(r) { |
231 } | 231 } |
232 | 232 |
233 EOF | 233 EOF |
234 | 234 |
235 $t->try_run('no njs available')->plan(23); | 235 $t->try_run('no njs available')->plan(26); |
236 | 236 |
237 ############################################################################### | 237 ############################################################################### |
238 | 238 |
239 | 239 |
240 like(http_get('/method'), qr/method=GET/, 'r.method'); | 240 like(http_get('/method'), qr/method=GET/, 'r.method'); |
242 like(http_get('/addr'), qr/addr=127.0.0.1/, 'r.remoteAddress'); | 242 like(http_get('/addr'), qr/addr=127.0.0.1/, 'r.remoteAddress'); |
243 like(http_get('/uri'), qr/uri=\/uri/, 'r.uri'); | 243 like(http_get('/uri'), qr/uri=\/uri/, 'r.uri'); |
244 like(http_get('/arg?foO=12345'), qr/arg=12345/, 'r.args'); | 244 like(http_get('/arg?foO=12345'), qr/arg=12345/, 'r.args'); |
245 like(http_get('/iarg?foo=12345&foo2=bar&nn=22&foo-3=z'), qr/12345barz/, | 245 like(http_get('/iarg?foo=12345&foo2=bar&nn=22&foo-3=z'), qr/12345barz/, |
246 'r.args iteration'); | 246 'r.args iteration'); |
247 | |
248 TODO: { | |
249 local $TODO = 'not yet' | |
250 unless http_get('/njs') =~ /^([.0-9]+)$/m && $1 ge '0.3.0'; | |
251 | |
252 like(http_get('/iarg?foo=123&foo2=&foo3&foo4=456'), qr/123undefined456/, | |
253 'r.args iteration 2'); | |
254 like(http_get('/iarg?foo=123&foo2=&foo3'), qr/123/, 'r.args iteration 3'); | |
255 like(http_get('/iarg?foo=123&foo2='), qr/123/, 'r.args iteration 4'); | |
256 | |
257 } | |
258 | |
247 like(http_get('/status'), qr/204 No Content/, 'r.status'); | 259 like(http_get('/status'), qr/204 No Content/, 'r.status'); |
248 | 260 |
249 like(http_post('/body'), qr/REQ-BODY/, 'request body'); | 261 like(http_post('/body'), qr/REQ-BODY/, 'request body'); |
250 like(http_post('/in_file'), qr/request body is in a file/, | 262 like(http_post('/in_file'), qr/request body is in a file/, |
251 'request body in file'); | 263 'request body in file'); |