From c9f8a2acddfb35c9a8277a87bab1f73ff13ea95a Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Mon, 28 Oct 2024 22:28:23 +0100 Subject: [PATCH] Fix newline character in test attachment string for Windows Updated the base64-encoded string for attachments in the tests to reflect the correct newline character for Windows. This ensures that the test cases correctly validate the presence of attachments in the mail messages. --- msgwriter_test.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/msgwriter_test.go b/msgwriter_test.go index 05de1e7..330507b 100644 --- a/msgwriter_test.go +++ b/msgwriter_test.go @@ -315,7 +315,7 @@ func TestMsgWriter_addFiles(t *testing.T) { } switch runtime.GOOS { case "windows": - if !strings.Contains(buffer.String(), "VGhpcyBpcyBhIHRlc3QgYXR0YWNobWVudAo") { + if !strings.Contains(buffer.String(), "VGhpcyBpcyBhIHRlc3QgYXR0YWNobWVudA0K") { t.Errorf("attachment not found in mail message. Mail: %s", buffer.String()) } default: @@ -348,7 +348,7 @@ func TestMsgWriter_addFiles(t *testing.T) { } switch runtime.GOOS { case "windows": - if !strings.Contains(buffer.String(), "VGhpcyBpcyBhIHRlc3QgYXR0YWNobWVudAo") { + if !strings.Contains(buffer.String(), "VGhpcyBpcyBhIHRlc3QgYXR0YWNobWVudA0K") { t.Errorf("attachment not found in mail message. Mail: %s", buffer.String()) } default: @@ -374,7 +374,7 @@ func TestMsgWriter_addFiles(t *testing.T) { } switch runtime.GOOS { case "windows": - if !strings.Contains(buffer.String(), "VGhpcyBpcyBhIHRlc3QgYXR0YWNobWVudAo") { + if !strings.Contains(buffer.String(), "VGhpcyBpcyBhIHRlc3QgYXR0YWNobWVudA0K") { t.Errorf("attachment not found in mail message. Mail: %s", buffer.String()) } default: @@ -429,7 +429,7 @@ func TestMsgWriter_addFiles(t *testing.T) { } switch runtime.GOOS { case "windows": - if !strings.Contains(buffer.String(), "VGhpcyBpcyBhIHRlc3QgYXR0YWNobWVudAo") { + if !strings.Contains(buffer.String(), "VGhpcyBpcyBhIHRlc3QgYXR0YWNobWVudA0K") { t.Errorf("attachment not found in mail message. Mail: %s", buffer.String()) } default: @@ -469,7 +469,7 @@ func TestMsgWriter_addFiles(t *testing.T) { } switch runtime.GOOS { case "windows": - if !strings.Contains(buffer.String(), "VGhpcyBpcyBhIHRlc3QgYXR0YWNobWVudAo") { + if !strings.Contains(buffer.String(), "VGhpcyBpcyBhIHRlc3QgYXR0YWNobWVudA0K") { t.Errorf("attachment not found in mail message. Mail: %s", buffer.String()) } default: