diff options
author | kaiwu <kaiwu2004@gmail.com> | 2025-03-01 12:42:23 +0800 |
---|---|---|
committer | kaiwu <kaiwu2004@gmail.com> | 2025-03-01 12:42:23 +0800 |
commit | 3f33461e4948bf05e60bdff35ec6c57a649c7860 (patch) | |
tree | 284c2ba95a41536ae1bff6bea710db0709a64739 /ngx_stream_lua-0.0.16/t/003-errors.t | |
download | openresty-3f33461e4948bf05e60bdff35ec6c57a649c7860.tar.gz openresty-3f33461e4948bf05e60bdff35ec6c57a649c7860.zip |
openresty bundle
Diffstat (limited to 'ngx_stream_lua-0.0.16/t/003-errors.t')
-rw-r--r-- | ngx_stream_lua-0.0.16/t/003-errors.t | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/ngx_stream_lua-0.0.16/t/003-errors.t b/ngx_stream_lua-0.0.16/t/003-errors.t new file mode 100644 index 0000000..381d817 --- /dev/null +++ b/ngx_stream_lua-0.0.16/t/003-errors.t @@ -0,0 +1,38 @@ +# vim:set ft= ts=4 sw=4 et fdm=marker: + +use Test::Nginx::Socket::Lua::Stream; + +repeat_each(2); + +plan tests => blocks() * (repeat_each() * 3); + +#$ENV{LUA_PATH} = $ENV{HOME} . '/work/JSON4Lua-0.9.30/json/?.lua'; + +no_long_string(); + +run_tests(); + +__DATA__ + +=== TEST 1: syntax error in lua code chunk +--- stream_server_config + content_by_lua_block {local a + a = a+; + return a} +--- stream_response +--- error_log eval +qr/failed to load inlined Lua code: content_by_lua\(nginx\.conf:\d+\):2: unexpected symbol near ';'/ + + + +=== TEST 2: syntax error in lua file +--- stream_server_config + content_by_lua_file 'html/test.lua'; +--- user_files +>>> test.lua +local a +a = 3 +; +return a +--- stream_response +--- error_log eval +qr{failed to load external Lua file ".*?html/test\.lua": .*?test\.lua:2: unexpected symbol near ';'} |