summaryrefslogtreecommitdiffhomepage
path: root/test/test_njs.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2023-01-24 01:12:22 +0000
committerAndrei Zeliankou <zelenkov@nginx.com>2023-01-24 01:12:22 +0000
commit05c56394587ae9bda36ce7e481af12caf76b5252 (patch)
tree9ffb12cebafbcbd5a7f9b8ea6859308de150c4f3 /test/test_njs.py
parent6dad38f6555d84a3e56a606c66f6b004820cc4ce (diff)
downloadunit-05c56394587ae9bda36ce7e481af12caf76b5252.tar.gz
unit-05c56394587ae9bda36ce7e481af12caf76b5252.tar.bz2
Tests: added NJS iteration tests.
Diffstat (limited to '')
-rw-r--r--test/test_njs.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_njs.py b/test/test_njs.py
index 1f564656..14662ff8 100644
--- a/test/test_njs.py
+++ b/test/test_njs.py
@@ -50,6 +50,12 @@ class TestNJS(TestApplicationProto):
self.check_expression('${uri + host}')
self.check_expression('${uri + `${host}`}')
+ def test_njs_iteration(self, temp_dir):
+ self.create_files('Connection,Host', 'close,localhost')
+
+ self.check_expression('/${Object.keys(headers).sort().join()}')
+ self.check_expression('/${Object.values(headers).sort().join()}')
+
def test_njs_variables(self, temp_dir):
self.create_files('str', 'localhost', '127.0.0.1')