Permalink
Browse files

First test case for multipart

  • Loading branch information...
bytbox committed Apr 4, 2012
1 parent facb573 commit e1967ffd0d8825d91249b38c0d8855c362eda820
Showing with 21 additions and 3 deletions.
  1. +1 −1 multipart.go
  2. +20 −2 multipart_test.go
View
@@ -12,6 +12,6 @@ type Part struct {
// present; otherwise, it will contain a single entry, with the entire (raw)
// message contents. The returned text will be an appropriate string
// representation of the first part of the message.
-func ParseBody(ct string, body []byte) (text string, parts []Part) {
+func ParseBody(ct string, body []byte) (text string, textct string, parts []Part) {
return
}
View
@@ -5,11 +5,29 @@ import (
)
type parseBodyTest struct {
-
+ ct string
+ body []byte
+ rt string
+ tct string
+ rps []Part
}
var parseBodyTests = []parseBodyTest{
-
+ parseBodyTest{
+ ct: "multipart/alternative; boundary=90e6ba1efd30b0013a04b8d4970f",
+ body: []byte(`
+--90e6ba1efd30b0013a04b8d4970f
+Content-Type: text/plain; charset=ISO-8859-1
+
+Some text.
+--90e6ba1efd30b0013a04b8d4970f
+Content-Type: text/html; charset=ISO-8859-1
+Content-Transfer-Encoding: quoted-printable
+
+Some other text.
+--90e6ba1efd30b0013a04b8d4970f--
+`),
+ },
}
func TestParseBody(t *testing.T) {

0 comments on commit e1967ff

Please sign in to comment.