diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/dicttest.lua | 2 | ||||
-rw-r--r-- | test/testmesg.lua | 13 |
2 files changed, 5 insertions, 10 deletions
diff --git a/test/dicttest.lua b/test/dicttest.lua index 9ab9c41..a0da2e1 100644 --- a/test/dicttest.lua +++ b/test/dicttest.lua | |||
@@ -1,3 +1,5 @@ | |||
1 | local dict = require"socket.dict" | 1 | local dict = require"socket.dict" |
2 | 2 | ||
3 | print(dict.get("dict://localhost/d:teste")) | ||
4 | |||
3 | for i,v in pairs(dict.get("dict://localhost/d:teste")) do print(v) end | 5 | for i,v in pairs(dict.get("dict://localhost/d:teste")) do print(v) end |
diff --git a/test/testmesg.lua b/test/testmesg.lua index 1dd9a97..5bec026 100644 --- a/test/testmesg.lua +++ b/test/testmesg.lua | |||
@@ -32,13 +32,6 @@ r, e = smtp.send{ | |||
32 | port = 2525 | 32 | port = 2525 |
33 | } | 33 | } |
34 | 34 | ||
35 | |||
36 | os.exit() | ||
37 | |||
38 | |||
39 | |||
40 | |||
41 | |||
42 | -- creates a source to send a message with two parts. The first part is | 35 | -- creates a source to send a message with two parts. The first part is |
43 | -- plain text, the second part is a PNG image, encoded as base64. | 36 | -- plain text, the second part is a PNG image, encoded as base64. |
44 | source = smtp.message{ | 37 | source = smtp.message{ |
@@ -67,13 +60,13 @@ source = smtp.message{ | |||
67 | -- chunks are loaded into memory and translation happens on the fly. | 60 | -- chunks are loaded into memory and translation happens on the fly. |
68 | [2] = { | 61 | [2] = { |
69 | headers = { | 62 | headers = { |
70 | ["content-type"] = 'image/png; name="image.png"', | 63 | ["content-type"] = 'image/png; name="luasocket.png"', |
71 | ["content-disposition"] = 'attachment; filename="image.png"', | 64 | ["content-disposition"] = 'attachment; filename="luasocket.png"', |
72 | ["content-description"] = 'a beautiful image', | 65 | ["content-description"] = 'a beautiful image', |
73 | ["content-transfer-encoding"] = "BASE64" | 66 | ["content-transfer-encoding"] = "BASE64" |
74 | }, | 67 | }, |
75 | body = ltn12.source.chain( | 68 | body = ltn12.source.chain( |
76 | ltn12.source.file(io.open("image.png", "rb")), | 69 | ltn12.source.file(io.open("luasocket.png", "rb")), |
77 | ltn12.filter.chain( | 70 | ltn12.filter.chain( |
78 | mime.encode("base64"), | 71 | mime.encode("base64"), |
79 | mime.wrap() | 72 | mime.wrap() |