diff options
author | Asbjørn Sloth Tønnesen <asbjorn@asbjorn.biz> | 2013-08-20 18:44:16 +0000 |
---|---|---|
committer | Emil Renner Berthing <esmil@mailme.dk> | 2013-08-22 13:21:58 +0200 |
commit | 72b7777c15ec2f806606cca8bff6211e4774daaa (patch) | |
tree | 8e6e6e3a3d2ad135659c62f8b3071e8f42c0f20e | |
parent | e7222887b3117baba8849eabca79e0a6e071ae7e (diff) | |
download | lem-72b7777c15ec2f806606cca8bff6211e4774daaa.tar.gz lem-72b7777c15ec2f806606cca8bff6211e4774daaa.tar.xz lem-72b7777c15ec2f806606cca8bff6211e4774daaa.zip |
hathaway: htest: fix single instance API usage
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-x | test/htest.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/htest.lua b/test/htest.lua index a94e4c6..efd864f 100755 --- a/test/htest.lua +++ b/test/htest.lua @@ -2,6 +2,7 @@ -- -- This file is part of LEM, a Lua Event Machine. -- Copyright 2011-2012 Emil Renner Berthing +-- Copyright 2013 Asbjørn Sloth Tønnesen -- -- LEM is free software: you can redistribute it and/or modify it -- under the terms of the GNU Lesser General Public License as @@ -23,7 +24,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 +149,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) |