diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-02-04 14:29:11 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-02-04 14:29:11 +0000 |
commit | 0b2542d1a61fc5425ff65ab3dbf7ba7de174763f (patch) | |
tree | 8a6188e11db0c9ef6891c31e8a1bebca050b23b2 /test/mimetest.lua | |
parent | f67864f86c7d703325e86b14d0ba33992c52891b (diff) | |
download | luasocket-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.lua | 15 |
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) |
182 | end | 182 | end |
183 | 183 | ||
184 | local 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) | ||
194 | end | ||
195 | |||
196 | |||
184 | local function padcheck(original, encoded) | 197 | local 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() | |||
233 | cleanup_b64test() | 246 | cleanup_b64test() |
234 | padding_b64test() | 247 | padding_b64test() |
235 | 248 | ||
249 | identity_test() | ||
250 | |||
236 | print(string.format("done in %.2fs", socket.time() - t)) | 251 | print(string.format("done in %.2fs", socket.time() - t)) |