From 64cfbf9e46637ae8d57a7cae33363a190f7df9a0 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Fri, 25 Oct 2024 09:53:49 +0200 Subject: [PATCH] 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. --- header_test.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/header_test.go b/header_test.go index 832c63d..bfe1d12 100644 --- a/header_test.go +++ b/header_test.go @@ -54,8 +54,7 @@ func TestImportance_Stringer(t *testing.T) { }) } -// TestAddrHeader_String tests the string method of the AddrHeader object -func TestAddrHeader_String(t *testing.T) { +func TestAddrHeader_Stringer(t *testing.T) { tests := []struct { name string ah AddrHeader @@ -76,13 +75,13 @@ func TestAddrHeader_String(t *testing.T) { } } -// TestHeader_String tests the string method of the Header object -func TestHeader_String(t *testing.T) { +func TestHeader_Stringer(t *testing.T) { tests := []struct { name string h Header want string }{ + {"Header: Content-Description", HeaderContentDescription, "Content-Description"}, {"Header: Content-Disposition", HeaderContentDisposition, "Content-Disposition"}, {"Header: Content-ID", HeaderContentID, "Content-ID"}, {"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-Type", HeaderContentType, "Content-Type"}, {"Header: Date", HeaderDate, "Date"}, + {"Header: Disposition-Notification-To", HeaderDispositionNotificationTo, + "Disposition-Notification-To"}, {"Header: Importance", HeaderImportance, "Importance"}, {"Header: In-Reply-To", HeaderInReplyTo, "In-Reply-To"}, {"Header: List-Unsubscribe", HeaderListUnsubscribe, "List-Unsubscribe"}, @@ -99,10 +100,11 @@ func TestHeader_String(t *testing.T) { {"Header: Organization", HeaderOrganization, "Organization"}, {"Header: Precedence", HeaderPrecedence, "Precedence"}, {"Header: Priority", HeaderPriority, "Priority"}, - {"Header: HeaderReferences", HeaderReferences, "References"}, + {"Header: References", HeaderReferences, "References"}, {"Header: Reply-To", HeaderReplyTo, "Reply-To"}, {"Header: Subject", HeaderSubject, "Subject"}, {"Header: User-Agent", HeaderUserAgent, "User-Agent"}, + {"Header: X-Auto-Response-Suppress", HeaderXAutoResponseSuppress, "X-Auto-Response-Suppress"}, {"Header: X-Mailer", HeaderXMailer, "X-Mailer"}, {"Header: X-MSMail-Priority", HeaderXMSMailPriority, "X-MSMail-Priority"}, {"Header: X-Priority", HeaderXPriority, "X-Priority"},