aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorame <[email protected]>2024-01-29 12:31:10 -0600
committerame <[email protected]>2024-01-29 12:31:10 -0600
commit83520e8eb6254c5e3eaa9c0ad04563e09d06ff55 (patch)
treefaa52e4b7bb7cdff545bd6a8ed7f8e095c4239ea /tests
parent79a85fd80a6e1af15e7d9b5ee96d3d77645993b3 (diff)
owo whats this? working code???
Diffstat (limited to 'tests')
-rw-r--r--tests/net.lua7
-rw-r--r--tests/s.lua8
2 files changed, 10 insertions, 5 deletions
diff --git a/tests/net.lua b/tests/net.lua
index d366e9b..b5052a9 100644
--- a/tests/net.lua
+++ b/tests/net.lua
@@ -16,8 +16,11 @@ llib.io.pprint(llib.net.listen(
--print(res.send)
--res:send("hi");
--res.Code = 201
- sleep(1)
- res:send("<h2>hello world</h2>")
+ --sleep(1)
+ local sec = tonumber(os.clock() + 1);
+ while (os.clock() < sec) do
+ end
+ --res:send("<h2>hello world</h2>")
end))
llib.io.pprint(server:GET("/test", function(res, req)
diff --git a/tests/s.lua b/tests/s.lua
index 5adc783..a543ff0 100644
--- a/tests/s.lua
+++ b/tests/s.lua
@@ -1,13 +1,15 @@
require "llib"
-function sleep (a)
+function _G.sleep (a)
local sec = tonumber(os.clock() + a);
while (os.clock() < sec) do
end
end
-for i=1,500 do
+for i=1,50 do
llib.net.spawn(function()
- --sleep(1)
+ local sec = tonumber(os.clock() + 1);
+ while (os.clock() < sec) do
+ end
print("hi")
end)
end