Skip to content

Commit 1c8e3ef

Browse files
committed
added a test for set_rotate: current value persistency is per location.
1 parent 9792e8d commit 1c8e3ef

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

t/rotate.t

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,51 @@ a = 2
221221
--- no_error_log
222222
[error]
223223

224+
225+
226+
=== TEST 9: value persistence is per-location
227+
--- config
228+
location /incr {
229+
set_rotate $a 0 2;
230+
231+
echo "a = $a";
232+
}
233+
234+
location /incr2 {
235+
set_rotate $a 0 2;
236+
237+
echo "a = $a";
238+
}
239+
240+
location /t {
241+
echo_location /incr;
242+
echo_location /incr2;
243+
echo_location /incr;
244+
echo_location /incr2;
245+
echo_location /incr;
246+
echo_location /incr2;
247+
echo_location /incr;
248+
echo_location /incr2;
249+
echo_location /incr;
250+
echo_location /incr2;
251+
echo_location /incr;
252+
echo_location /incr2;
253+
}
254+
--- request
255+
GET /t
256+
--- response_body
257+
a = 0
258+
a = 0
259+
a = 1
260+
a = 1
261+
a = 2
262+
a = 2
263+
a = 0
264+
a = 0
265+
a = 1
266+
a = 1
267+
a = 2
268+
a = 2
269+
--- no_error_log
270+
[error]
271+

0 commit comments

Comments
 (0)