Skip to content

Commit 383c4b5

Browse files
committed
Test errors when not initialised
1 parent 558c502 commit 383c4b5

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

t/01-basic.t

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,3 +236,39 @@ GET /a
236236
--- no_error_log
237237
[error]
238238
[warn]
239+
240+
241+
=== TEST 8: Errors when not initialized
242+
--- http_config eval: $::HttpConfig
243+
--- config
244+
location = /a {
245+
content_by_lua '
246+
local http = require "resty.http"
247+
248+
local res, err = http:set_timeout(500)
249+
if not res then ngx.say(err) end
250+
251+
local res, err = http:ssl_handshake()
252+
if not res then ngx.say(err) end
253+
254+
local res, err = http:set_keepalive()
255+
if not res then ngx.say(err) end
256+
257+
local res, err = http:get_reused_times()
258+
if not res then ngx.say(err) end
259+
260+
local res, err = http:close()
261+
if not res then ngx.say(err) end
262+
';
263+
}
264+
--- request
265+
GET /a
266+
--- response_body
267+
not initialized
268+
not initialized
269+
not initialized
270+
not initialized
271+
not initialized
272+
--- no_error_log
273+
[error]
274+
[warn]

0 commit comments

Comments
 (0)