Skip to content

Commit 7df41f4

Browse files
committed
add the test case
1 parent db2be0a commit 7df41f4

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

t/13-default-path.t

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# vim:set ft= ts=4 sw=4 et fdm=marker:
2+
use lib 'lib';
3+
use Test::Nginx::Socket::Lua;
4+
use Cwd qw(cwd);
5+
6+
my $pwd = cwd();
7+
8+
our $HttpConfig = qq{
9+
lua_package_path "$pwd/lib/?.lua;;";
10+
};
11+
12+
$ENV{TEST_NGINX_RESOLVER} = '8.8.8.8';
13+
14+
#worker_connections(1014);
15+
#master_on();
16+
workers(2);
17+
#log_level('warn');
18+
19+
repeat_each(2);
20+
#repeat_each(1);
21+
22+
plan tests => repeat_each() * (blocks() * 3);
23+
24+
#no_diff();
25+
#no_long_string();
26+
run_tests();
27+
28+
29+
__DATA__
30+
31+
=== TEST 1: request_uri (check the default path)
32+
--- config
33+
location /lua {
34+
content_by_lua '
35+
local http = require "resty.http"
36+
local httpc = http.new()
37+
38+
local res, err = httpc:request_uri("http://127.0.0.1:"..ngx.var.server_port)
39+
40+
if res and 200 == res.status then
41+
ngx.print("OK")
42+
else
43+
ngx.print("FAIL")
44+
end
45+
';
46+
}
47+
48+
location =/ {
49+
content_by_lua '
50+
ngx.print("OK")
51+
';
52+
}
53+
--- request
54+
GET /lua
55+
--- response_body_like chop
56+
OK$
57+
--- no_error_log
58+
[error]
59+

0 commit comments

Comments
 (0)