Rename test functions and add new header cases.

Renamed test functions from `TestHeader_String` to `TestHeader_Stringer` and `TestAddrHeader_String` to `TestAddrHeader_Stringer` for consistency. Additionally, added new header cases such as "Content-Description" and "X-Auto-Response-Suppress" to improve test coverage.
This commit is contained in:
Winni Neessen 2024-10-25 09:53:49 +02:00
parent c58d52e49a
commit 64cfbf9e46
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -54,8 +54,7 @@ func TestImportance_Stringer(t *testing.T) {
}) })
} }
// TestAddrHeader_String tests the string method of the AddrHeader object func TestAddrHeader_Stringer(t *testing.T) {
func TestAddrHeader_String(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
ah AddrHeader ah AddrHeader
@ -76,13 +75,13 @@ func TestAddrHeader_String(t *testing.T) {
} }
} }
// TestHeader_String tests the string method of the Header object func TestHeader_Stringer(t *testing.T) {
func TestHeader_String(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
h Header h Header
want string want string
}{ }{
{"Header: Content-Description", HeaderContentDescription, "Content-Description"},
{"Header: Content-Disposition", HeaderContentDisposition, "Content-Disposition"}, {"Header: Content-Disposition", HeaderContentDisposition, "Content-Disposition"},
{"Header: Content-ID", HeaderContentID, "Content-ID"}, {"Header: Content-ID", HeaderContentID, "Content-ID"},
{"Header: Content-Language", HeaderContentLang, "Content-Language"}, {"Header: Content-Language", HeaderContentLang, "Content-Language"},
@ -90,6 +89,8 @@ func TestHeader_String(t *testing.T) {
{"Header: Content-Transfer-Encoding", HeaderContentTransferEnc, "Content-Transfer-Encoding"}, {"Header: Content-Transfer-Encoding", HeaderContentTransferEnc, "Content-Transfer-Encoding"},
{"Header: Content-Type", HeaderContentType, "Content-Type"}, {"Header: Content-Type", HeaderContentType, "Content-Type"},
{"Header: Date", HeaderDate, "Date"}, {"Header: Date", HeaderDate, "Date"},
{"Header: Disposition-Notification-To", HeaderDispositionNotificationTo,
"Disposition-Notification-To"},
{"Header: Importance", HeaderImportance, "Importance"}, {"Header: Importance", HeaderImportance, "Importance"},
{"Header: In-Reply-To", HeaderInReplyTo, "In-Reply-To"}, {"Header: In-Reply-To", HeaderInReplyTo, "In-Reply-To"},
{"Header: List-Unsubscribe", HeaderListUnsubscribe, "List-Unsubscribe"}, {"Header: List-Unsubscribe", HeaderListUnsubscribe, "List-Unsubscribe"},
@ -99,10 +100,11 @@ func TestHeader_String(t *testing.T) {
{"Header: Organization", HeaderOrganization, "Organization"}, {"Header: Organization", HeaderOrganization, "Organization"},
{"Header: Precedence", HeaderPrecedence, "Precedence"}, {"Header: Precedence", HeaderPrecedence, "Precedence"},
{"Header: Priority", HeaderPriority, "Priority"}, {"Header: Priority", HeaderPriority, "Priority"},
{"Header: HeaderReferences", HeaderReferences, "References"}, {"Header: References", HeaderReferences, "References"},
{"Header: Reply-To", HeaderReplyTo, "Reply-To"}, {"Header: Reply-To", HeaderReplyTo, "Reply-To"},
{"Header: Subject", HeaderSubject, "Subject"}, {"Header: Subject", HeaderSubject, "Subject"},
{"Header: User-Agent", HeaderUserAgent, "User-Agent"}, {"Header: User-Agent", HeaderUserAgent, "User-Agent"},
{"Header: X-Auto-Response-Suppress", HeaderXAutoResponseSuppress, "X-Auto-Response-Suppress"},
{"Header: X-Mailer", HeaderXMailer, "X-Mailer"}, {"Header: X-Mailer", HeaderXMailer, "X-Mailer"},
{"Header: X-MSMail-Priority", HeaderXMSMailPriority, "X-MSMail-Priority"}, {"Header: X-MSMail-Priority", HeaderXMSMailPriority, "X-MSMail-Priority"},
{"Header: X-Priority", HeaderXPriority, "X-Priority"}, {"Header: X-Priority", HeaderXPriority, "X-Priority"},