File tree Expand file tree Collapse file tree 1 file changed +91
-0
lines changed
Expand file tree Collapse file tree 1 file changed +91
-0
lines changed Original file line number Diff line number Diff line change @@ -78,3 +78,94 @@ GET /t
7878["[error]",
7979qr/ -- NYI: (?!FastFunc coroutine.yield)/,
8080" bad argument"]
81+
82+
83+
84+ === TEST 3: accepts NGX_OK
85+ --- config
86+ location = /t {
87+ content_by_lua_block {
88+ ngx.exit(ngx.OK)
89+ }
90+ }
91+ --- request
92+ GET /t
93+ --- response_body
94+ --- no_error_log eval
95+ ["[error]",
96+ qr/ -- NYI: (?!FastFunc coroutine.yield)/,
97+ " bad argument"]
98+
99+
100+
101+ === TEST 4: accepts NGX_ERROR
102+ --- config
103+ location = /t {
104+ content_by_lua_block {
105+ ngx.exit(ngx.ERROR)
106+ }
107+ }
108+ --- request
109+ GET /t
110+ --- error_code:
111+ --- response_body
112+ --- no_error_log eval
113+ ["[error]",
114+ qr/ -- NYI: (?!FastFunc coroutine.yield)/,
115+ " bad argument"]
116+
117+
118+
119+ === TEST 5: accepts NGX_DECLINED
120+ --- config
121+ location = /t {
122+ content_by_lua_block {
123+ ngx.exit(ngx.DECLINED)
124+ }
125+ }
126+ --- request
127+ GET /t
128+ --- error_code:
129+ --- response_body
130+ --- no_error_log eval
131+ ["[error]",
132+ qr/ -- NYI: (?!FastFunc coroutine.yield)/,
133+ " bad argument"]
134+
135+
136+
137+ === TEST 6: refuses NGX_AGAIN
138+ --- config
139+ location = /t {
140+ content_by_lua_block {
141+ ngx.exit(ngx.AGAIN)
142+ }
143+ }
144+ --- request
145+ GET /t
146+ --- response_body_like: 500 Internal Server Error
147+ --- error_code: 500
148+ --- error_log eval
149+ qr/\[error\] .*? bad argument to 'ngx.exit': does not accept NGX_AGAIN or NGX_DONE/
150+ --- no_error_log eval
151+ qr/ -- NYI: (?!FastFunc coroutine.yield)/
152+ [crit]
153+
154+
155+
156+ === TEST 7: refuses NGX_DONE
157+ --- config
158+ location = /t {
159+ content_by_lua_block {
160+ ngx.exit(ngx.DONE)
161+ }
162+ }
163+ --- request
164+ GET /t
165+ --- response_body_like: 500 Internal Server Error
166+ --- error_code: 500
167+ --- error_log eval
168+ qr/\[error\] .*? bad argument to 'ngx.exit': does not accept NGX_AGAIN or NGX_DONE/
169+ --- no_error_log eval
170+ qr/ -- NYI: (?!FastFunc coroutine.yield)/
171+ [crit]
You can’t perform that action at this time.
0 commit comments