diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-06-17 21:46:22 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-06-17 21:46:22 +0000 |
commit | 597a062b1bc38488df1363995eece8a9f19c7111 (patch) | |
tree | ba4ccaa8be98d1100aed63abb9c42c099f2c41bb /test | |
parent | eac26d2c8dafab604ef2e97e504326cfaf1033cf (diff) | |
download | luasocket-597a062b1bc38488df1363995eece8a9f19c7111.tar.gz luasocket-597a062b1bc38488df1363995eece8a9f19c7111.tar.bz2 luasocket-597a062b1bc38488df1363995eece8a9f19c7111.zip |
Almost ready for distribution...
Diffstat (limited to 'test')
-rw-r--r-- | test/README | 13 | ||||
-rw-r--r-- | test/ltn12test.lua | 5 | ||||
-rw-r--r-- | test/stufftest.lua | 6 | ||||
-rw-r--r-- | test/testmesg.lua | 7 |
4 files changed, 7 insertions, 24 deletions
diff --git a/test/README b/test/README index 2502e20..180fa27 100644 --- a/test/README +++ b/test/README | |||
@@ -5,19 +5,8 @@ The files provided are: | |||
5 | 5 | ||
6 | testsrvr.lua -- test server | 6 | testsrvr.lua -- test server |
7 | testclnt.lua -- test client | 7 | testclnt.lua -- test client |
8 | testcmd.lua -- test command definitions | ||
9 | 8 | ||
10 | To run the automatic tests on your system, make sure to compile the | 9 | To run these tests, just run lua on the server and then on the client. |
11 | library with _DEBUG defined (check makefile) and then open two | ||
12 | terminals. Run 'luasocket testsrvr.lua' on one of them and 'luasocket | ||
13 | testclnt.lua' on the other. The programs should start talking to each | ||
14 | other and report any failure. The tests can also be used as a benchmark. | ||
15 | |||
16 | urltest.lua -- url.lua test module | ||
17 | codetest.lua -- code.lua test module | ||
18 | concattest.lua -- concat.lua test module | ||
19 | |||
20 | To run these tests, just run luasocket on them and see the results. | ||
21 | 10 | ||
22 | Good luck, | 11 | Good luck, |
23 | Diego. | 12 | Diego. |
diff --git a/test/ltn12test.lua b/test/ltn12test.lua deleted file mode 100644 index 04749a5..0000000 --- a/test/ltn12test.lua +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | a = ltn12.source.file(io.open("luasocket.lua")) | ||
2 | b = ltn12.source.file(io.open("auxiliar.lua")) | ||
3 | c = ltn12.source.cat(a, b) | ||
4 | d = ltn12.sink.file(io.stdout) | ||
5 | socket.try(ltn12.pump.all(c, d)) | ||
diff --git a/test/stufftest.lua b/test/stufftest.lua index 6bd1f91..eddf636 100644 --- a/test/stufftest.lua +++ b/test/stufftest.lua | |||
@@ -1,13 +1,13 @@ | |||
1 | smtp = require("smtp") | 1 | mime = require("mime") |
2 | 2 | ||
3 | function test_dot(original, right) | 3 | function test_dot(original, right) |
4 | local result, n = smtp.dot(2, original) | 4 | local result, n = mime.dot(2, original) |
5 | assert(result == right, "->" .. result .. "<-") | 5 | assert(result == right, "->" .. result .. "<-") |
6 | print("ok") | 6 | print("ok") |
7 | end | 7 | end |
8 | 8 | ||
9 | function test_stuff(original, right) | 9 | function test_stuff(original, right) |
10 | local result, n = smtp.dot(2, original) | 10 | local result, n = mime.dot(2, original) |
11 | assert(result == right, "->" .. result .. "<-") | 11 | assert(result == right, "->" .. result .. "<-") |
12 | print("ok") | 12 | print("ok") |
13 | end | 13 | end |
diff --git a/test/testmesg.lua b/test/testmesg.lua index d43c189..3555031 100644 --- a/test/testmesg.lua +++ b/test/testmesg.lua | |||
@@ -50,10 +50,9 @@ source = smtp.message{ | |||
50 | 50 | ||
51 | -- finally send it | 51 | -- finally send it |
52 | r, e = smtp.send{ | 52 | r, e = smtp.send{ |
53 | rcpt = "<diego@cs.princeton.edu>", | 53 | rcpt = "<fulano@tecgraf.puc-rio.br>", |
54 | from = "<diego@cs.princeton.edu>", | 54 | from = "<sicrano@tecgraf.puc-rio.br>", |
55 | source = source, | 55 | source = source |
56 | server = "mail.cs.princeton.edu" | ||
57 | } | 56 | } |
58 | 57 | ||
59 | print(r, e) | 58 | print(r, e) |