aboutsummaryrefslogtreecommitdiff
path: root/test/mimetest.lua
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-02-04 14:29:11 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-02-04 14:29:11 +0000
commit0b2542d1a61fc5425ff65ab3dbf7ba7de174763f (patch)
tree8a6188e11db0c9ef6891c31e8a1bebca050b23b2 /test/mimetest.lua
parentf67864f86c7d703325e86b14d0ba33992c52891b (diff)
downloadluasocket-0b2542d1a61fc5425ff65ab3dbf7ba7de174763f.tar.gz
luasocket-0b2542d1a61fc5425ff65ab3dbf7ba7de174763f.tar.bz2
luasocket-0b2542d1a61fc5425ff65ab3dbf7ba7de174763f.zip
Worked on the manual.
Implemented stuffing (needs test) Added cddb and qp examples.
Diffstat (limited to 'test/mimetest.lua')
-rw-r--r--test/mimetest.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/mimetest.lua b/test/mimetest.lua
index 81814de..5a461fa 100644
--- a/test/mimetest.lua
+++ b/test/mimetest.lua
@@ -181,6 +181,19 @@ local function compare_b64test()
181 compare(b64test, db64test) 181 compare(b64test, db64test)
182end 182end
183 183
184local function identity_test()
185 local chain = socket.mime.chain(
186 socket.mime.encode("quoted-printable"),
187 socket.mime.encode("base64"),
188 socket.mime.decode("base64"),
189 socket.mime.decode("quoted-printable")
190 )
191 transform(b64test, eb64test, chain)
192 compare(b64test, eb64test)
193 os.remove(eb64test)
194end
195
196
184local function padcheck(original, encoded) 197local function padcheck(original, encoded)
185 local e = (socket.mime.b64(original)) 198 local e = (socket.mime.b64(original))
186 local d = (socket.mime.unb64(encoded)) 199 local d = (socket.mime.unb64(encoded))
@@ -233,4 +246,6 @@ compare_b64test()
233cleanup_b64test() 246cleanup_b64test()
234padding_b64test() 247padding_b64test()
235 248
249identity_test()
250
236print(string.format("done in %.2fs", socket.time() - t)) 251print(string.format("done in %.2fs", socket.time() - t))