diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2003-08-16 00:06:04 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2003-08-16 00:06:04 +0000 |
commit | c51d4acf1c2a8675a3bb043e799ff4390cef47d6 (patch) | |
tree | 345b71aa70b50c964a58980461e147a260fa6e0b /test/smtptest.lua | |
parent | 3099704affa1fda195eb8f3934f6c1f18bf1f706 (diff) | |
download | luasocket-c51d4acf1c2a8675a3bb043e799ff4390cef47d6.tar.gz luasocket-c51d4acf1c2a8675a3bb043e799ff4390cef47d6.tar.bz2 luasocket-c51d4acf1c2a8675a3bb043e799ff4390cef47d6.zip |
Adjusted a few inconsistencies with the manual.
Diffstat (limited to 'test/smtptest.lua')
-rw-r--r-- | test/smtptest.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/smtptest.lua b/test/smtptest.lua index 09bf634..8468408 100644 --- a/test/smtptest.lua +++ b/test/smtptest.lua | |||
@@ -209,27 +209,27 @@ insert(sent, { | |||
209 | 209 | ||
210 | io.write("testing host not found: ") | 210 | io.write("testing host not found: ") |
211 | local c, e = socket.connect("wrong.host", 25) | 211 | local c, e = socket.connect("wrong.host", 25) |
212 | local err = socket.smtp.mail{ | 212 | local ret, err = socket.smtp.mail{ |
213 | from = from, | 213 | from = from, |
214 | rcpt = rcpt, | 214 | rcpt = rcpt, |
215 | server = "wrong.host" | 215 | server = "wrong.host" |
216 | } | 216 | } |
217 | if e ~= err then fail("wrong error message") | 217 | if ret or e ~= err then fail("wrong error message") |
218 | else print("ok") end | 218 | else print("ok") end |
219 | 219 | ||
220 | io.write("testing invalid from: ") | 220 | io.write("testing invalid from: ") |
221 | local err = socket.smtp.mail{ | 221 | local ret, err = socket.smtp.mail{ |
222 | from = ' " " (( _ * ', | 222 | from = ' " " (( _ * ', |
223 | rcpt = rcpt, | 223 | rcpt = rcpt, |
224 | } | 224 | } |
225 | if not err then fail("wrong error message") | 225 | if ret or not err then fail("wrong error message") |
226 | else print(err) end | 226 | else print(err) end |
227 | 227 | ||
228 | io.write("testing no rcpt: ") | 228 | io.write("testing no rcpt: ") |
229 | local err = socket.smtp.mail{ | 229 | local ret, err = socket.smtp.mail{ |
230 | from = from, | 230 | from = from, |
231 | } | 231 | } |
232 | if not err then fail("wrong error message") | 232 | if ret or not err then fail("wrong error message") |
233 | else print(err) end | 233 | else print(err) end |
234 | 234 | ||
235 | io.write("clearing mailbox: ") | 235 | io.write("clearing mailbox: ") |
@@ -238,8 +238,8 @@ print("ok") | |||
238 | 238 | ||
239 | io.write("sending messages: ") | 239 | io.write("sending messages: ") |
240 | for i = 1, table.getn(sent) do | 240 | for i = 1, table.getn(sent) do |
241 | err = socket.smtp.mail(sent[i]) | 241 | ret, err = socket.smtp.mail(sent[i]) |
242 | if err then fail(err) end | 242 | if not ret then fail(err) end |
243 | io.write("+") | 243 | io.write("+") |
244 | io.stdout:flush() | 244 | io.stdout:flush() |
245 | end | 245 | end |