Almost ready for distribution...
This commit is contained in:
parent
eac26d2c8d
commit
597a062b1b
14 changed files with 323 additions and 161 deletions
13
test/README
13
test/README
|
@ -5,19 +5,8 @@ The files provided are:
|
|||
|
||||
testsrvr.lua -- test server
|
||||
testclnt.lua -- test client
|
||||
testcmd.lua -- test command definitions
|
||||
|
||||
To run the automatic tests on your system, make sure to compile the
|
||||
library with _DEBUG defined (check makefile) and then open two
|
||||
terminals. Run 'luasocket testsrvr.lua' on one of them and 'luasocket
|
||||
testclnt.lua' on the other. The programs should start talking to each
|
||||
other and report any failure. The tests can also be used as a benchmark.
|
||||
|
||||
urltest.lua -- url.lua test module
|
||||
codetest.lua -- code.lua test module
|
||||
concattest.lua -- concat.lua test module
|
||||
|
||||
To run these tests, just run luasocket on them and see the results.
|
||||
To run these tests, just run lua on the server and then on the client.
|
||||
|
||||
Good luck,
|
||||
Diego.
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
a = ltn12.source.file(io.open("luasocket.lua"))
|
||||
b = ltn12.source.file(io.open("auxiliar.lua"))
|
||||
c = ltn12.source.cat(a, b)
|
||||
d = ltn12.sink.file(io.stdout)
|
||||
socket.try(ltn12.pump.all(c, d))
|
|
@ -1,13 +1,13 @@
|
|||
smtp = require("smtp")
|
||||
mime = require("mime")
|
||||
|
||||
function test_dot(original, right)
|
||||
local result, n = smtp.dot(2, original)
|
||||
local result, n = mime.dot(2, original)
|
||||
assert(result == right, "->" .. result .. "<-")
|
||||
print("ok")
|
||||
end
|
||||
|
||||
function test_stuff(original, right)
|
||||
local result, n = smtp.dot(2, original)
|
||||
local result, n = mime.dot(2, original)
|
||||
assert(result == right, "->" .. result .. "<-")
|
||||
print("ok")
|
||||
end
|
||||
|
|
|
@ -50,10 +50,9 @@ source = smtp.message{
|
|||
|
||||
-- finally send it
|
||||
r, e = smtp.send{
|
||||
rcpt = "<diego@cs.princeton.edu>",
|
||||
from = "<diego@cs.princeton.edu>",
|
||||
source = source,
|
||||
server = "mail.cs.princeton.edu"
|
||||
rcpt = "<fulano@tecgraf.puc-rio.br>",
|
||||
from = "<sicrano@tecgraf.puc-rio.br>",
|
||||
source = source
|
||||
}
|
||||
|
||||
print(r, e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue