summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAsbjørn Sloth Tønnesen <asbjorn@asbjorn.biz>2013-08-20 18:44:16 +0000
committerAsbjørn Sloth Tønnesen <asbjorn@asbjorn.biz>2013-08-20 19:01:10 +0000
commit86211c6ad217798f1a4eb919021552fd232835f2 (patch)
tree6d1cc5ecf0bc48feec7fcbd83b454632ffeeec7e
parent6033b687f47f33a75c45db3b55ef4731e5b348e3 (diff)
downloadlem-multi-hathaway.tar.gz
lem-multi-hathaway.tar.xz
lem-multi-hathaway.zip
hathaway: htest: fix single instance API usagemulti-hathaway
When using the single instance API hathaway.debug MUST be overwritten before calling import in order to have any effect. Signed-off-by: Asbjørn Sloth Tønnesen <asbjorn@asbjorn.biz>
-rwxr-xr-xtest/htest.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/htest.lua b/test/htest.lua
index a94e4c6..c24a042 100755
--- a/test/htest.lua
+++ b/test/htest.lua
@@ -23,7 +23,9 @@ package.cpath = '?.so'
local utils = require 'lem.utils'
local io = require 'lem.io'
local hathaway = require 'lem.hathaway'
-hathaway.import()
+
+hathaway.debug = print -- must be set before import()
+hathaway.import() -- when using single instance API
GET('/', function(req, res)
print(req.client:getpeer())
@@ -146,7 +148,6 @@ GETM('^/hello/([^/]+)$', function(req, res, name)
res:add('Hello, %s!\n', name)
end)
-hathaway.debug = print
if arg[1] == 'socket' then
local sock = assert(io.unix.listen('socket', 666))
Hathaway(sock)