diff options
| author | ame <[email protected]> | 2024-08-03 02:30:02 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2024-08-03 02:30:02 -0500 |
| commit | 37dc46c19843f3328e06c7199548238f056c1a6b (patch) | |
| tree | cbfee9fffc70d07bfd6b632e1f73b17da19d578c /tests/net.lua | |
| parent | 3aaf4185c489830ff6c56c9a359584d5003f92ec (diff) | |
fix tests, module based require, thread improvments
Diffstat (limited to 'tests/net.lua')
| -rw-r--r-- | tests/net.lua | 63 |
1 files changed, 16 insertions, 47 deletions
diff --git a/tests/net.lua b/tests/net.lua index 1afd02f..25ca696 100644 --- a/tests/net.lua +++ b/tests/net.lua @@ -1,66 +1,35 @@ -llib = require "llib"
-llib.config.set({max_depth=5})
---local print = llib.io.pprint
+--yes, this is kinda a mess of requires, just proof it works:3
+net = require "lullaby.net"
+io = require "lullaby.io"
+crypto = require "lullaby.crypto"
+config = require "lullaby.config"
+
+config.set({max_depth=5})
+
sleep = function(a)
local sec = tonumber(os.clock() + a);
while (os.clock() < sec) do
end
end
-aea = 5
-local wowa = 5
---_G.wo = llib
-_G._llib = _G.llib
---_G.ww = llib
---llib.io.pprint(_G)
-llib.net.listen(
+
+net.listen(
function(server)
- --llib = nil
- --llib.io.pprint(_G)
- llib.io.pprint("online")
+
+ io.pprint("online")
_G.server = server
server:all("/", function(res, req)
- b = llib.crypto.md5("hello")
+ b = crypto.md5("hello")
- --llib.io.pprint(a + '5')
res:send(b)
- --llib.io.pprint(res)
- --llib.io.pprint(res)
- --print(res.send)
- --res:send("hi");
- --res.Code = 201
- --wwo.sleep(1)
- --wwo.llib.io.pprint(wwo.sleep)
- --require "llib"
- --llib.io.pprint(_G)
- --_G.llib.io.pprint(_G.ww)
- --llib.io.pprint(_G.wo)
- --print("hi from first")
- --llib.io.pprint(llib.crypto.md5("hewwo"))
- --_G.sleep(1)
- --_G.llib.io.pprint(_G._G._G._llib.crypto.md5("hi"))
- --_G.llib.io.pprint(_G._Go)
- --_G.llib.io.pprint(_G.wo.crypto.md5("55"))
- --_G.llib.io.pprint(req)
- --print(req.partial)
- --_G.llib.io.pprint(_G.llib.io.readfile(".gitignore"))
- --print(req._bytes)
- --res:send(_G.llib.io.readfile("llib.dll"))
- --_G.llib.io.pprint(_G.llib.crypto.md5(_G.llib.io.readfile(".gitignore")))
- --_G.llib.io.pprint(req)
- --_G.llib.io.pprint(req)
- --print("start")
a = req:roll()
- --print(a)
+
while a > -1 do
a = req:roll()
print(req._bytes .. "/" .. req["Content-Length"])
- --print(a)
end
- llib.io.pprint(req)
- --_G.llib.io.pprint(req)
- --_G.llib.io.pprint("hi")
- --res:send("done")
+ io.pprint(req)
+
end)
server:GET("/aa", function(res, req)
|
