@@ -10,7 +10,7 @@ use Test::Nginx::Socket::Lua;
10
10
repeat_each(2 );
11
11
# repeat_each(1);
12
12
13
- plan tests => repeat_each() * (blocks() * 3 + 4 );
13
+ plan tests => repeat_each() * (blocks() * 3 + 3 );
14
14
15
15
# no_diff();
16
16
no_long_string();
@@ -405,7 +405,7 @@ hello, world!
405
405
406
406
407
407
408
- === TEST 16 : content_by_lua_block ( unexpected closing long brackets)
408
+ === TEST 16 : content_by_lua_block unexpected closing long brackets must FAIL
409
409
-- - config
410
410
location = /t {
411
411
content_by_lua_block {
@@ -414,15 +414,30 @@ hello, world!
414
414
}
415
415
--- request
416
416
GET /t
417
+ -- - error_code: 500
418
+ -- - error_log eval
419
+ qr{\[error\] .*? unexpected symbol near ' ]' }
420
+
421
+
422
+
423
+ === TEST 17 : content_by_lua_block unexpected closing long brackets ignored (GitHub # 748)
424
+ -- - config
425
+ location = /t {
426
+ content_by_lua_block {
427
+ local t1, t2 = {" hello world" }, {1 }
428
+ ngx. say (t1[t2[1 ]])
429
+ }
430
+ }
431
+ --- request
432
+ GET /t
433
+ -- - response_body
434
+ hello world
417
435
-- - no_error_log
418
436
[error]
419
- -- - error_log eval
420
- qr{\[emerg\] .*? unexpected lua closing long -bracket in .*?/ nginx\. conf: 41 }
421
- -- - must_die
422
437
423
438
424
439
425
- === TEST 17 : simple set_by_lua_block (integer)
440
+ === TEST 18 : simple set_by_lua_block (integer)
426
441
-- - config
427
442
location / lua {
428
443
set_by_lua_block $ res { return 1 + 1 }
@@ -437,7 +452,7 @@ GET /lua
437
452
438
453
439
454
440
- === TEST 18 : ambiguous line comments inside a long bracket string (GitHub # 596)
455
+ === TEST 19 : ambiguous line comments inside a long bracket string (GitHub # 596)
441
456
-- - config
442
457
location = /t {
443
458
content_by_lua_block {
459
474
460
475
461
476
462
- === TEST 19 : double quotes in long brackets
477
+ === TEST 20 : double quotes in long brackets
463
478
-- - config
464
479
location = /t {
465
480
rewrite_by_lua_block { print ([[Hey, it is " !]]) } content_by_lua_block { ngx. say ([[" ]]) }
@@ -475,7 +490,7 @@ Hey, it is "!
475
490
476
491
477
492
478
- === TEST 20 : single quotes in long brackets
493
+ === TEST 21 : single quotes in long brackets
479
494
--- config
480
495
location = /t {
481
496
rewrite_by_lua_block { print ([[Hey, it is ' !]]) } content_by_lua_block { ngx.say([[' ]]) }
@@ -491,7 +506,7 @@ Hey, it is '!
491
506
492
507
493
508
494
- === TEST 21 : lexer no match due to incomplete data chunks in a fixed size buffer
509
+ === TEST 22 : lexer no match due to incomplete data chunks in a fixed size buffer
495
510
--- config
496
511
location /test1 {
497
512
content_by_lua_block {
0 commit comments