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.
This commit is contained in:
Winni Neessen 2024-10-28 22:28:23 +01:00
parent b63a3dab9a
commit c9f8a2acdd
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -315,7 +315,7 @@ func TestMsgWriter_addFiles(t *testing.T) {
} }
switch runtime.GOOS { switch runtime.GOOS {
case "windows": 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()) t.Errorf("attachment not found in mail message. Mail: %s", buffer.String())
} }
default: default:
@ -348,7 +348,7 @@ func TestMsgWriter_addFiles(t *testing.T) {
} }
switch runtime.GOOS { switch runtime.GOOS {
case "windows": 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()) t.Errorf("attachment not found in mail message. Mail: %s", buffer.String())
} }
default: default:
@ -374,7 +374,7 @@ func TestMsgWriter_addFiles(t *testing.T) {
} }
switch runtime.GOOS { switch runtime.GOOS {
case "windows": 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()) t.Errorf("attachment not found in mail message. Mail: %s", buffer.String())
} }
default: default:
@ -429,7 +429,7 @@ func TestMsgWriter_addFiles(t *testing.T) {
} }
switch runtime.GOOS { switch runtime.GOOS {
case "windows": 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()) t.Errorf("attachment not found in mail message. Mail: %s", buffer.String())
} }
default: default:
@ -469,7 +469,7 @@ func TestMsgWriter_addFiles(t *testing.T) {
} }
switch runtime.GOOS { switch runtime.GOOS {
case "windows": 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()) t.Errorf("attachment not found in mail message. Mail: %s", buffer.String())
} }
default: default: