From f8a271a027c0008944b5d89aaa8b6d4153d15160 Mon Sep 17 00:00:00 2001 From: Bruno Deferrari Date: Thu, 24 Apr 2014 21:27:16 -0300 Subject: [PATCH] Add a basic test app for the lua plugin --- t/lua/basic.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 t/lua/basic.lua diff --git a/t/lua/basic.lua b/t/lua/basic.lua new file mode 100644 index 00000000..29cec7c1 --- /dev/null +++ b/t/lua/basic.lua @@ -0,0 +1,14 @@ +function hello(wsapi_env) + local headers = { ["Content-type"] = "text/html", ["set-cookie"] = {"foo=bar", "bar=baz"} } + local function hello_text() + coroutine.yield("") + coroutine.yield("

Hello Wsapi!

") + coroutine.yield("

PATH_INFO: " .. wsapi_env.PATH_INFO .. "

") + coroutine.yield("

SCRIPT_NAME: " .. wsapi_env.SCRIPT_NAME .. "

") + coroutine.yield("

QUERY_STRING: " .. wsapi_env.QUERY_STRING .. "

") + coroutine.yield("") + end + return 200, headers, coroutine.wrap(hello_text) +end + +return hello