Mercurial > hg > nginx-tests
comparison js_return.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 | 9bc1ca067449 |
children | 18ac4d9e5a2a |
comparison
equal
deleted
inserted
replaced
1613:d7ec131d305a | 1614:bc0990ea2e5b |
---|---|
41 | 41 |
42 server { | 42 server { |
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 location /njs { | |
47 js_content test_njs; | |
48 } | |
49 | |
50 location / { | 46 location / { |
51 js_content test_return; | 47 js_content test_return; |
52 } | 48 } |
53 } | 49 } |
54 } | 50 } |
55 | 51 |
56 EOF | 52 EOF |
57 | 53 |
58 $t->write_file('test.js', <<EOF); | 54 $t->write_file('test.js', <<EOF); |
59 function test_njs(r) { | |
60 r.return(200, njs.version); | |
61 } | |
62 | |
63 function test_return(r) { | 55 function test_return(r) { |
64 r.return(Number(r.args.c), r.args.t); | 56 r.return(Number(r.args.c), r.args.t); |
65 } | 57 } |
66 | 58 |
67 EOF | 59 EOF |