diff options
| author | ame <[email protected]> | 2024-01-29 09:54:16 -0600 |
|---|---|---|
| committer | ame <[email protected]> | 2024-01-29 09:54:16 -0600 |
| commit | 79a85fd80a6e1af15e7d9b5ee96d3d77645993b3 (patch) | |
| tree | 17bf2d289774788cfafc4504930737a3e9885101 /tests | |
| parent | a53d2ae92f02ea3efc01c5b76ce8471de3d4e879 (diff) | |
test
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/net.lua | 60 | ||||
| -rw-r--r-- | tests/s.lua | 28 |
2 files changed, 44 insertions, 44 deletions
diff --git a/tests/net.lua b/tests/net.lua index af8ef6e..d366e9b 100644 --- a/tests/net.lua +++ b/tests/net.lua @@ -1,31 +1,31 @@ -require "llib" -llib.config.set({max_depth=5}) ---local print = llib.io.pprint -function sleep (a) - local sec = tonumber(os.clock() + a); - while (os.clock() < sec) do - end -end -llib.io.pprint(llib.net.listen( - function(server) - print("wowa") - - llib.io.pprint(server:GET("/", function(res, req) - --llib.io.pprint(res) - --llib.io.pprint(res) - --print(res.send) - --res:send("hi"); - --res.Code = 201 - sleep(1) - res:send("<h2>hello world</h2>") - end)) - - llib.io.pprint(server:GET("/test", function(res, req) - res.Code = 403 - res:send("<h2>you would never</h2>") - end)) - - - end, - 8080 +require "llib"
+llib.config.set({max_depth=5})
+--local print = llib.io.pprint
+function sleep (a)
+ local sec = tonumber(os.clock() + a);
+ while (os.clock() < sec) do
+ end
+end
+llib.io.pprint(llib.net.listen(
+ function(server)
+ print("wowa")
+
+ llib.io.pprint(server:GET("/", function(res, req)
+ --llib.io.pprint(res)
+ --llib.io.pprint(res)
+ --print(res.send)
+ --res:send("hi");
+ --res.Code = 201
+ sleep(1)
+ res:send("<h2>hello world</h2>")
+ end))
+
+ llib.io.pprint(server:GET("/test", function(res, req)
+ res.Code = 403
+ res:send("<h2>you would never</h2>")
+ end))
+
+
+ end,
+ 8080
))
\ No newline at end of file diff --git a/tests/s.lua b/tests/s.lua index 51c0b6a..5adc783 100644 --- a/tests/s.lua +++ b/tests/s.lua @@ -1,15 +1,15 @@ -require "llib" -function sleep (a) - local sec = tonumber(os.clock() + a); - while (os.clock() < sec) do - end -end - -for i=1,500 do - llib.net.spawn(function() - --sleep(1) - print("hi") - end) -end - +require "llib"
+function sleep (a)
+ local sec = tonumber(os.clock() + a);
+ while (os.clock() < sec) do
+ end
+end
+
+for i=1,500 do
+ llib.net.spawn(function()
+ --sleep(1)
+ print("hi")
+ end)
+end
+
while true do end
\ No newline at end of file |
