[nginx-tests] Tests: another test with variables which change be...
Maxim Dounin
mdounin at mdounin.ru
Sat Jul 25 00:05:34 UTC 2026
details: http://freenginx.org/hg/nginx-tests/rev/1d795d140c18
branches:
changeset: 2080:1d795d140c18
user: Maxim Dounin <mdounin at mdounin.ru>
date: Sun Jul 19 00:23:40 2026 +0300
description:
Tests: another test with variables which change between accesses.
A test with "return" and map with side effects added, which covers
ngx_http_complex_value() usage.
diffstat:
rewrite.t | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diffs (42 lines):
diff --git a/rewrite.t b/rewrite.t
--- a/rewrite.t
+++ b/rewrite.t
@@ -21,7 +21,7 @@ use Test::Nginx;
select STDERR; $| = 1;
select STDOUT; $| = 1;
-my $t = Test::Nginx->new()->has(qw/http rewrite proxy/)->plan(26)
+my $t = Test::Nginx->new()->has(qw/http rewrite proxy/)->plan(27)
->write_file_expand('nginx.conf', <<'EOF');
%%TEST_GLOBALS%%
@@ -150,6 +150,10 @@ http {
rewrite ^ $capture$map_capture redirect;
}
+ location /map_return/ {
+ return 200 $capture$map_capture;
+ }
+
location /break {
rewrite ^ /return200;
break;
@@ -283,7 +287,7 @@ like(http_get('/capture_nested/%25?a=b')
}
TODO: {
-todo_skip 'might coredump', 1
+todo_skip 'might coredump', 2
unless $t->has_version('1.31.3')
or $ENV{TEST_NGINX_UNSAFE};
local $TODO = 'not yet', $t->todo_alerts();
@@ -291,6 +295,9 @@ local $TODO = 'not yet', $t->todo_alerts
like(http_get('/map/test-long-uri'), qr!Location: .*/map/test-long-uri!ms,
'rewrite and map with side effects');
+like(http_get('/map_return/test-long-uri'), qr!.*/map_return/test-long-uri!,
+ 'return and map with side effects');
+
}
# break
More information about the nginx-devel
mailing list