File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ repeat_each(2);
4
4
5
5
plan tests => repeat_each() * (blocks() * 3);
6
6
7
+ our $HtmlDir = html_dir;
8
+
7
9
add_block_preprocessor(sub {
8
10
my $block = shift ;
9
11
@@ -66,3 +68,30 @@ resty.core loaded: false
66
68
}
67
69
--- response_body
68
70
resty.core loaded: true
71
+
72
+
73
+
74
+ === TEST 4: lua_load_resty_core honors the lua_package_path directive
75
+ --- http_config eval
76
+ "lua_package_path '$::HtmlDir/?.lua;;';"
77
+ --- config
78
+ location = /t {
79
+ content_by_lua_block {
80
+ local loaded_resty_core = package.loaded["resty.core"]
81
+ local resty_core = require "resty.core"
82
+
83
+ ngx.say("resty.core loaded: ", loaded_resty_core == resty_core)
84
+
85
+ resty_core.go()
86
+ }
87
+ }
88
+ --- response_body
89
+ resty.core loaded: true
90
+ loaded from html dir
91
+ --- user_files
92
+ >>> resty/core.lua
93
+ return {
94
+ go = function ()
95
+ ngx.say("loaded from html dir")
96
+ end
97
+ }
You can’t perform that action at this time.
0 commit comments