Skip to content

Commit

Permalink
add test cases for base64 (from ryotosaito:master DusanKasan#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Hros committed Sep 2, 2023
1 parent 8b06747 commit ea3da3a
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions parsemail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,31 @@ So, "Hello".`,
htmlBody: rfc2045exampleBhtml,
textBody: "Time for the egg. Should we hardboil the egg or fry it. We can scramble it or poach it.",
},
18: {
contentType: "multipart/alternative; boundary=\"000000000000ab2e1f05a26de586\"",
mailData: base64Content,
subject: "Saying Hello",
from: []mail.Address{
{
Name: "John Doe",
Address: "[email protected]",
},
},
sender: mail.Address{
Name: "Michael Jones",
Address: "[email protected]",
},
to: []mail.Address{
{
Name: "Mary Smith",
Address: "[email protected]",
},
},
messageID: "[email protected]",
date: parseDate("Fri, 21 Nov 1997 09:55:06 -0600"),
htmlBody: "<div dir=\"ltr\">👍</div>",
textBody: "👍",
},
}

for index, td := range testData {
Expand Down Expand Up @@ -1310,3 +1335,26 @@ t.</div>
--000000000000ab2e2205a26de587--
`
var base64Content = `MIME-Version: 1.0
From: John Doe <[email protected]>
Sender: Michael Jones <[email protected]>
To: Mary Smith <[email protected]>
Subject: Saying Hello
Date: Fri, 21 Nov 1997 09:55:06 -0600
Message-ID: <[email protected]>
Content-Type: multipart/alternative; boundary="000000000000ab2e1f05a26de586"
--000000000000ab2e1f05a26de586
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: base64
8J+RjQo=
--000000000000ab2e1f05a26de586
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: base64
PGRpdiBkaXI9Imx0ciI+8J+RjTwvZGl2Pgo=
--000000000000ab2e1f05a26de586--
`

0 comments on commit ea3da3a

Please sign in to comment.