Fix typo in Content-Disposition header in tests

Corrected multiple instances of the misspelled "Content-Dispositon" to "Content-Disposition" in the msgwriter_test.go file. This ensures that the error messages in the tests are accurate and improve code readability.
This commit is contained in:
Winni Neessen 2024-11-11 20:08:58 +01:00
parent c7438a974c
commit 29794fd6ad
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -324,7 +324,7 @@ func TestMsgWriter_addFiles(t *testing.T) {
} }
} }
if !strings.Contains(buffer.String(), `Content-Disposition: attachment; filename="attachment.txt"`) { if !strings.Contains(buffer.String(), `Content-Disposition: attachment; filename="attachment.txt"`) {
t.Errorf("Content-Dispositon header not found for attachment. Mail: %s", buffer.String()) t.Errorf("Content-Disposition header not found for attachment. Mail: %s", buffer.String())
} }
switch runtime.GOOS { switch runtime.GOOS {
case "freebsd": case "freebsd":
@ -357,7 +357,7 @@ func TestMsgWriter_addFiles(t *testing.T) {
} }
} }
if !strings.Contains(buffer.String(), `Content-Disposition: attachment; filename="attachment"`) { if !strings.Contains(buffer.String(), `Content-Disposition: attachment; filename="attachment"`) {
t.Errorf("Content-Dispositon header not found for attachment. Mail: %s", buffer.String()) t.Errorf("Content-Disposition header not found for attachment. Mail: %s", buffer.String())
} }
if !strings.Contains(buffer.String(), `Content-Type: application/octet-stream; name="attachment"`) { if !strings.Contains(buffer.String(), `Content-Type: application/octet-stream; name="attachment"`) {
t.Errorf("Content-Type header not found for attachment. Mail: %s", buffer.String()) t.Errorf("Content-Type header not found for attachment. Mail: %s", buffer.String())
@ -383,7 +383,7 @@ func TestMsgWriter_addFiles(t *testing.T) {
} }
} }
if !strings.Contains(buffer.String(), `Content-Disposition: attachment; filename="attachment.txt"`) { if !strings.Contains(buffer.String(), `Content-Disposition: attachment; filename="attachment.txt"`) {
t.Errorf("Content-Dispositon header not found for attachment. Mail: %s", buffer.String()) t.Errorf("Content-Disposition header not found for attachment. Mail: %s", buffer.String())
} }
if !strings.Contains(buffer.String(), `Content-Type: application/octet-stream; name="attachment.txt"`) { if !strings.Contains(buffer.String(), `Content-Type: application/octet-stream; name="attachment.txt"`) {
t.Errorf("Content-Type header not found for attachment. Mail: %s", buffer.String()) t.Errorf("Content-Type header not found for attachment. Mail: %s", buffer.String())
@ -402,7 +402,7 @@ func TestMsgWriter_addFiles(t *testing.T) {
t.Errorf("attachment not found in mail message. Mail: %s", buffer.String()) t.Errorf("attachment not found in mail message. Mail: %s", buffer.String())
} }
if !strings.Contains(buffer.String(), `Content-Disposition: attachment; filename="attachment.txt"`) { if !strings.Contains(buffer.String(), `Content-Disposition: attachment; filename="attachment.txt"`) {
t.Errorf("Content-Dispositon header not found for attachment. Mail: %s", buffer.String()) t.Errorf("Content-Disposition header not found for attachment. Mail: %s", buffer.String())
} }
switch runtime.GOOS { switch runtime.GOOS {
case "freebsd": case "freebsd":
@ -438,7 +438,7 @@ func TestMsgWriter_addFiles(t *testing.T) {
} }
} }
if !strings.Contains(buffer.String(), `Content-Disposition: attachment; filename="attachment.txt"`) { if !strings.Contains(buffer.String(), `Content-Disposition: attachment; filename="attachment.txt"`) {
t.Errorf("Content-Dispositon header not found for attachment. Mail: %s", buffer.String()) t.Errorf("Content-Disposition header not found for attachment. Mail: %s", buffer.String())
} }
switch runtime.GOOS { switch runtime.GOOS {
case "freebsd": case "freebsd":
@ -478,7 +478,7 @@ func TestMsgWriter_addFiles(t *testing.T) {
} }
} }
if !strings.Contains(buffer.String(), `Content-Disposition: attachment; filename="attachment.txt"`) { if !strings.Contains(buffer.String(), `Content-Disposition: attachment; filename="attachment.txt"`) {
t.Errorf("Content-Dispositon header not found for attachment. Mail: %s", buffer.String()) t.Errorf("Content-Disposition header not found for attachment. Mail: %s", buffer.String())
} }
switch runtime.GOOS { switch runtime.GOOS {
case "freebsd": case "freebsd":