Skip to content

Commit eef59b1

Browse files
committed
Update tests, debug logging, global variable warnings
1 parent b02f3dc commit eef59b1

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

t/01-basic.t

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ bad uri: http:///example.com
304304
content_by_lua '
305305
local http = require("resty.http").new()
306306
307-
function test_uri(uri)
307+
local function test_uri(uri)
308308
local scheme, host, port, path, query = unpack(http:parse_uri(uri, false))
309309
ngx.say("scheme: ", scheme, ", host: ", host, ", port: ", port, ", path: ", path, ", query: ", query)
310310
end
@@ -342,7 +342,7 @@ scheme: http, host: example.com, port: 80, path: /foo/bar, query: a=1&b=2
342342
content_by_lua '
343343
local http = require("resty.http").new()
344344
345-
function test_uri(uri)
345+
local function test_uri(uri)
346346
local scheme, host, port, path, query = unpack(http:parse_uri(uri))
347347
ngx.say("scheme: ", scheme, ", host: ", host, ", port: ", port, ", path: ", path)
348348
end
@@ -410,4 +410,4 @@ Test
410410
OK
411411
--- no_error_log
412412
[error]
413-
[warn]
413+
[warn]

t/14-host-header.t

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ our $HttpConfig = qq{
1919
jit.off()
2020
require("luacov.runner").init()
2121
end
22+
23+
require("resty.http").debug(true)
2224
}
2325
};
2426

@@ -89,6 +91,7 @@ Host: www.google.com
8991
--- config
9092
location /lua {
9193
content_by_lua '
94+
require("resty.http").debug(true)
9295
local http = require "resty.http"
9396
local httpc = http.new()
9497
@@ -117,6 +120,7 @@ Host: 127.0.0.1:8080
117120
--- config
118121
location /lua {
119122
content_by_lua '
123+
require("resty.http").debug(true)
120124
local http = require "resty.http"
121125
local httpc = http.new()
122126
@@ -178,6 +182,7 @@ Unable to generate a useful Host header for a unix domain socket. Please provide
178182
--- config
179183
location /lua {
180184
content_by_lua '
185+
require("resty.http").debug(true)
181186
local http = require "resty.http"
182187
local httpc = http.new()
183188
httpc:set_proxy_options({

t/16-http-proxy.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ nil
5757

5858
-- helper that verifies get_proxy_uri works correctly with the given
5959
-- scheme, host and no_proxy list
60-
function test_no_proxy(scheme, host, no_proxy)
60+
local function test_no_proxy(scheme, host, no_proxy)
6161
httpc:set_proxy_options({
6262
http_proxy = "http://http_proxy.example.com",
6363
https_proxy = "http://https_proxy.example.com",
@@ -126,7 +126,7 @@ scheme: http, host: notexample.com, no_proxy: example.com, proxy_uri: http://htt
126126

127127
-- helper that configures the proxy opts as proived and checks what
128128
-- get_proxy_uri says for the given scheme / host pair
129-
function test_get_proxy_uri(scheme, host, http_proxy, https_proxy)
129+
local function test_get_proxy_uri(scheme, host, http_proxy, https_proxy)
130130
httpc:set_proxy_options({
131131
http_proxy = http_proxy,
132132
https_proxy = https_proxy

0 commit comments

Comments
 (0)