aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorame <[email protected]>2024-05-25 04:08:59 -0500
committerame <[email protected]>2024-05-25 04:08:59 -0500
commit237fcfbd61a9895326538a274f025d9ed57a3903 (patch)
tree44c36c7d38ae68f562a0290c26bae4a79ab87f1e /tests
parent8d169e81694b587a425993cb11297e8a9183b37c (diff)
fixed deepcopy
Diffstat (limited to 'tests')
-rw-r--r--tests/h.lua31
-rw-r--r--tests/net.lua8
2 files changed, 20 insertions, 19 deletions
diff --git a/tests/h.lua b/tests/h.lua
index ca946fc..412d09c 100644
--- a/tests/h.lua
+++ b/tests/h.lua
@@ -1,32 +1,29 @@
require "llib"
+llib.config.set({print_meta=1,max_depth=22})
--llib.thread.lock(1)
--llib.thread.lock(2)
--llib.thread.unlock(2)
+a = llib.thread.buffer(llib.crypto.md5())
-local thread_a = llib.thread.async(function (res)
- --os.execute("sleep 1")
- --print((_G.ll + "hi"):final())
- print("waiting..")
- --llib.thread.lock(1)
- _G.test = 5
- print("signal!")
- res(llib.thread.async(function (res)
- print(test)
- res(test)
- end))
- print("after")
-end)
+a:mod(function(e) return e end)
+print("hi")
+for i=1,20 do
+ llib.thread.async(function (res)
+ a:mod(function(e) return e:update("meow") end)
+ end)
+end
---os.execute("sleep 1")
+os.execute("sleep 1")
+print(a:get():final())
--print("unlock")
--llib.thread.unlock(1)
-awa = thread_a:await()
+--awa = thread_a:await()
-print(awa:await())
+--print(awa:await())
--print((awa + "hi"):final())
-thread_a:clean()
+--thread_a:clean()
print("clean exit")
diff --git a/tests/net.lua b/tests/net.lua
index 228a29b..88b551e 100644
--- a/tests/net.lua
+++ b/tests/net.lua
@@ -12,7 +12,7 @@ local wowa = 5
_G._llib = _G.llib
--_G.ww = llib
--llib.io.pprint(_G)
-
+a = llib.crypto.md5
llib.net.listen(
function(server)
--llib = nil
@@ -20,6 +20,10 @@ llib.net.listen(
llib.io.pprint("online")
_G.server = server
server:all("/", function(res, req)
+ b = a("hello")
+
+ --llib.io.pprint(a + '5')
+ res:send(b)
--llib.io.pprint(res)
--llib.io.pprint(res)
--print(res.send)
@@ -57,7 +61,7 @@ llib.net.listen(
--_G.llib.io.pprint(req.files)
--_G.llib.io.pprint(req)
--_G.llib.io.pprint("hi")
- res:send("done")
+ --res:send("done")
end)
server:GET("/aa", function(res, req)