-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test cases for base64 (from ryotosaito:master #24)
- Loading branch information
Mario Hros
committed
Sep 2, 2023
1 parent
8b06747
commit ea3da3a
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 { | ||
|
@@ -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-- | ||
` |