mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-22 07:09:18 +02:00
Updating mime tests.
This commit is contained in:
parent
7fa49f0747
commit
e0db95d3de
1 changed files with 71 additions and 0 deletions
|
@ -6,6 +6,9 @@
|
|||
(test '(text/html (charset . "UTF-8") (filename . "index.html"))
|
||||
(mime-parse-content-type "text/html; CHARSET=UTF-8; filename=index.html"))
|
||||
|
||||
(test '(multipart/form-data (boundary . "AaB03x"))
|
||||
(mime-parse-content-type "multipart/form-data, boundary=AaB03x"))
|
||||
|
||||
(test '(mime (@ (from . "\"Dr. Watson <guest@grimpen.moor>\"")
|
||||
(to . "\"Sherlock Homes <not-really@221B-baker.street>\"")
|
||||
(subject . "\"First Report\"")
|
||||
|
@ -22,4 +25,72 @@ Moor is gloomy. Heard strange noise, attached.
|
|||
"
|
||||
mime-message->sxml))
|
||||
|
||||
;; from rfc 1867
|
||||
|
||||
(test '(mime
|
||||
(@ (content-type . "multipart/form-data, boundary=AaB03x"))
|
||||
(mime (@ (content-disposition . "form-data; name=\"field1\""))
|
||||
"Joe Blow")
|
||||
(mime (@ (content-disposition
|
||||
. "form-data; name=\"pics\"; filename=\"file1.txt\"")
|
||||
(content-type . "text/plain"))
|
||||
" ... contents of file1.txt ..."))
|
||||
(call-with-input-string
|
||||
"Content-type: multipart/form-data, boundary=AaB03x
|
||||
|
||||
--AaB03x
|
||||
content-disposition: form-data; name=\"field1\"
|
||||
|
||||
Joe Blow
|
||||
--AaB03x
|
||||
content-disposition: form-data; name=\"pics\"; filename=\"file1.txt\"
|
||||
Content-Type: text/plain
|
||||
|
||||
... contents of file1.txt ...
|
||||
--AaB03x--
|
||||
"
|
||||
mime-message->sxml))
|
||||
|
||||
(test '(mime
|
||||
(@ (content-type . "multipart/form-data, boundary=AaB03x"))
|
||||
(mime (@ (content-disposition . "form-data; name=\"field1\""))
|
||||
"Joe Blow")
|
||||
(mime (@ (content-disposition . "form-data; name=\"pics\"")
|
||||
(content-type . "multipart/mixed, boundary=BbC04y"))
|
||||
(mime (@ (content-disposition
|
||||
. "attachment; filename=\"file1.txt\"")
|
||||
(content-type . "text/plain"))
|
||||
"... contents of file1.txt ...")
|
||||
(mime (@ (content-disposition
|
||||
. "attachment; filename=\"file2.gif\"")
|
||||
(content-type . "image/gif")
|
||||
(content-transfer-encoding . "binary"))
|
||||
" ...contents of file2.gif...")))
|
||||
(call-with-input-string
|
||||
"Content-type: multipart/form-data, boundary=AaB03x
|
||||
|
||||
--AaB03x
|
||||
content-disposition: form-data; name=\"field1\"
|
||||
|
||||
Joe Blow
|
||||
--AaB03x
|
||||
content-disposition: form-data; name=\"pics\"
|
||||
Content-type: multipart/mixed, boundary=BbC04y
|
||||
|
||||
--BbC04y
|
||||
Content-disposition: attachment; filename=\"file1.txt\"
|
||||
Content-Type: text/plain
|
||||
|
||||
... contents of file1.txt ...
|
||||
--BbC04y
|
||||
Content-disposition: attachment; filename=\"file2.gif\"
|
||||
Content-type: image/gif
|
||||
Content-Transfer-Encoding: binary
|
||||
|
||||
...contents of file2.gif...
|
||||
--BbC04y--
|
||||
--AaB03x--
|
||||
"
|
||||
mime-message->sxml))
|
||||
|
||||
(test-end)
|
||||
|
|
Loading…
Add table
Reference in a new issue