aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/h.lua2
-rw-r--r--tests/net.lua16
-rw-r--r--tests/net2.lua3
3 files changed, 11 insertions, 10 deletions
diff --git a/tests/h.lua b/tests/h.lua
index dfe5f79..a875b42 100644
--- a/tests/h.lua
+++ b/tests/h.lua
@@ -1,5 +1,5 @@
llib = require "lullaby"
-llib.config.set({print_meta = 1})
+llib.io.print_meta = 1
local a = llib.crypto.sha1()
diff --git a/tests/net.lua b/tests/net.lua
index af66756..f5e57f9 100644
--- a/tests/net.lua
+++ b/tests/net.lua
@@ -1,10 +1,9 @@
--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"
+local io = require "lullaby.io"
+local crypto = require "lullaby.crypto"
-config.set({max_depth=5})
+io.max_depth = 5
sleep = function(a)
local sec = tonumber(os.clock() + a);
@@ -19,26 +18,27 @@ net.listen(
_G.server = server
server:POST("/{name}", function(res, req)
+ eroifjeor()
--print("name is "..req.name)
print("name")
- io.pprint(req.paramaters)
+ io.pprint(req.parameters)
res:stop()
end)
server:all("/{name}/nya/{user}", function(res, req)
--print("name is "..req.name)
print("name user")
- io.pprint(req.paramaters)
+ io.pprint(req.parameters)
end)
server:all("*", function(res, req)
print("all")
- io.pprint(req.paramaters)
+ io.pprint(req.parameters)
end)
server:all("/{name}/user/*/{id}", function(res, req)
print("owo")
- io.pprint(req.paramaters)
+ io.pprint(req.parameters)
end)
diff --git a/tests/net2.lua b/tests/net2.lua
index 0ef3644..bb69051 100644
--- a/tests/net2.lua
+++ b/tests/net2.lua
@@ -1,6 +1,6 @@
--(this is in tests/net2.lua)
net = require "lullaby.net"
-crypto = require "lullaby.crypto"
+local crypto = require "lullaby.crypto"
local port = 8080
MAX_LENGTH = 2048
@@ -15,6 +15,7 @@ net.listen(function(server)
--incremental hashes allow updating via addition, in this case adding the body and getting a string from it
hash = (hash + req.Body):final()
+ print(hash, crypto)
--send the hash to the client, closes connection, but thread is live until it ends
res:send(hash)
end)