aboutsummaryrefslogtreecommitdiff
path: root/test/smtptest.lua
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2003-08-16 00:06:04 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2003-08-16 00:06:04 +0000
commitc51d4acf1c2a8675a3bb043e799ff4390cef47d6 (patch)
tree345b71aa70b50c964a58980461e147a260fa6e0b /test/smtptest.lua
parent3099704affa1fda195eb8f3934f6c1f18bf1f706 (diff)
downloadluasocket-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.lua16
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
210io.write("testing host not found: ") 210io.write("testing host not found: ")
211local c, e = socket.connect("wrong.host", 25) 211local c, e = socket.connect("wrong.host", 25)
212local err = socket.smtp.mail{ 212local 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}
217if e ~= err then fail("wrong error message") 217if ret or e ~= err then fail("wrong error message")
218else print("ok") end 218else print("ok") end
219 219
220io.write("testing invalid from: ") 220io.write("testing invalid from: ")
221local err = socket.smtp.mail{ 221local ret, err = socket.smtp.mail{
222 from = ' " " (( _ * ', 222 from = ' " " (( _ * ',
223 rcpt = rcpt, 223 rcpt = rcpt,
224} 224}
225if not err then fail("wrong error message") 225if ret or not err then fail("wrong error message")
226else print(err) end 226else print(err) end
227 227
228io.write("testing no rcpt: ") 228io.write("testing no rcpt: ")
229local err = socket.smtp.mail{ 229local ret, err = socket.smtp.mail{
230 from = from, 230 from = from,
231} 231}
232if not err then fail("wrong error message") 232if ret or not err then fail("wrong error message")
233else print(err) end 233else print(err) end
234 234
235io.write("clearing mailbox: ") 235io.write("clearing mailbox: ")
@@ -238,8 +238,8 @@ print("ok")
238 238
239io.write("sending messages: ") 239io.write("sending messages: ")
240for i = 1, table.getn(sent) do 240for 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()
245end 245end