# HG changeset patch # User Dmitry Volyntsev # Date 1544526764 -10800 # Node ID 215f3357034b82d769b0b7fea9bf8fe218f1f787 # Parent aaaa8a40250b6f5696a6c8c04ed19ffffbdf58f0 Tests: njs http global code. diff --git a/js2.t b/js2.t --- a/js2.t +++ b/js2.t @@ -46,6 +46,7 @@ http { js_set $test_arg test_arg; js_set $test_iarg test_iarg; js_set $test_var test_var; + js_set $test_global test_global; js_set $test_log test_log; js_set $test_except test_except; @@ -95,6 +96,10 @@ http { return 200 $test_var; } + location /global { + return 200 $test_global; + } + location /body { js_content request_body; } @@ -161,6 +166,8 @@ http { EOF $t->write_file('test.js', <plan(34); +$t->try_run('no njs available')->plan(35); ############################################################################### @@ -363,6 +374,7 @@ like(http_get('/return_method?c=inv'), q like(http_get('/return_headers'), qr/Foo: bar/, 'return headers'); like(http_get('/var'), qr/variable=127.0.0.1/, 'r.variables'); +like(http_get('/global'), qr/global=njs/, 'global code'); like(http_get('/log'), qr/200 OK/, 'r.log'); http_get('/except');