comparison js_variables.t @ 1614:bc0990ea2e5b

Tests: js TODO adjusted up to 0.4.0.
author Dmitry Volyntsev <xeioex@nginx.com>
date Tue, 17 Nov 2020 17:49:16 +0000
parents 9521130f6f22
children 18ac4d9e5a2a
comparison
equal deleted inserted replaced
1613:d7ec131d305a 1614:bc0990ea2e5b
43 listen 127.0.0.1:8080; 43 listen 127.0.0.1:8080;
44 server_name localhost; 44 server_name localhost;
45 45
46 set $foo foo_orig; 46 set $foo foo_orig;
47 47
48 location /njs {
49 js_content test_njs;
50 }
51
52 location /var_set { 48 location /var_set {
53 return 200 $test_var$foo; 49 return 200 $test_var$foo;
54 } 50 }
55 51
56 location /content_set { 52 location /content_set {
64 } 60 }
65 61
66 EOF 62 EOF
67 63
68 $t->write_file('test.js', <<EOF); 64 $t->write_file('test.js', <<EOF);
69 function test_njs(r) {
70 r.return(200, njs.version);
71 }
72
73 function test_var(r) { 65 function test_var(r) {
74 r.variables.foo = r.variables.arg_a; 66 r.variables.foo = r.variables.arg_a;
75 return 'test_var'; 67 return 'test_var';
76 } 68 }
77 69