Skip to content

Commit

Permalink
Merge pull request #362 from wneessen/fix-spelling
Browse files Browse the repository at this point in the history
Fix spelling in some tests
  • Loading branch information
wneessen authored Nov 11, 2024
2 parents 580ef5e + 29794fd commit 26f1ed3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2803,7 +2803,7 @@ func TestClient_sendSingleMsg(t *testing.T) {
t.Errorf("expected ErrGetSender, got %s", sendErr.Reason)
}
})
t.Run("fail with no recepient addresses", func(t *testing.T) {
t.Run("fail with no recipient addresses", func(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
PortAdder.Add(1)
Expand Down
12 changes: 6 additions & 6 deletions msg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ var (
{`" "@domain.tld`, true}, // Still valid, since quoted
{`"<\"@\".!#%[email protected]"`, false}, // Quoting with illegal characters is not allowed
{`<\"@\\".!#%[email protected]`, false}, // Still a bunch of random illegal characters
{`hi"@"[email protected]`, false}, // Quotes must be dot-seperated
{`"<\"@\\".!.#%[email protected]`, false}, // Quote is escaped and dot-seperated which would be RFC822 compliant, but not RFC5322 compliant
{`hi"@"[email protected]`, false}, // Quotes must be dot-separated
{`"<\"@\\".!.#%[email protected]`, false}, // Quote is escaped and dot-separated which would be RFC822 compliant, but not RFC5322 compliant
{`hi\ [email protected]`, false}, // Spaces must be quoted
{"hello@tld", true}, // TLD is enough
{`你好@域名.顶级域名`, true}, // We speak RFC6532
Expand Down Expand Up @@ -4527,12 +4527,12 @@ func TestMsg_AttachFile(t *testing.T) {
t.Errorf("expected message body to be %s, got: %s", "This is a test attachment", got)
}
})
t.Run("AttachFile with non-existant file", func(t *testing.T) {
t.Run("AttachFile with non-existent file", func(t *testing.T) {
message := NewMsg()
if message == nil {
t.Fatal("message is nil")
}
message.AttachFile("testdata/non-existant-file.txt")
message.AttachFile("testdata/non-existent-file.txt")
attachments := message.GetAttachments()
if len(attachments) != 0 {
t.Fatalf("failed to retrieve attachments list")
Expand Down Expand Up @@ -4997,12 +4997,12 @@ func TestMsg_EmbedFile(t *testing.T) {
t.Errorf("expected message body to be %s, got: %s", "This is a test embed", got)
}
})
t.Run("EmbedFile with non-existant file", func(t *testing.T) {
t.Run("EmbedFile with non-existent file", func(t *testing.T) {
message := NewMsg()
if message == nil {
t.Fatal("message is nil")
}
message.EmbedFile("testdata/non-existant-file.txt")
message.EmbedFile("testdata/non-existent-file.txt")
embeds := message.GetEmbeds()
if len(embeds) != 0 {
t.Fatalf("failed to retrieve attachments list")
Expand Down
12 changes: 6 additions & 6 deletions msgwriter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ func TestMsgWriter_addFiles(t *testing.T) {
}
}
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 {
case "freebsd":
Expand Down Expand Up @@ -357,7 +357,7 @@ func TestMsgWriter_addFiles(t *testing.T) {
}
}
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"`) {
t.Errorf("Content-Type header not found for attachment. Mail: %s", buffer.String())
Expand All @@ -383,7 +383,7 @@ func TestMsgWriter_addFiles(t *testing.T) {
}
}
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"`) {
t.Errorf("Content-Type header not found for attachment. Mail: %s", buffer.String())
Expand All @@ -402,7 +402,7 @@ func TestMsgWriter_addFiles(t *testing.T) {
t.Errorf("attachment not found in mail message. Mail: %s", buffer.String())
}
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 {
case "freebsd":
Expand Down Expand Up @@ -438,7 +438,7 @@ func TestMsgWriter_addFiles(t *testing.T) {
}
}
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 {
case "freebsd":
Expand Down Expand Up @@ -478,7 +478,7 @@ func TestMsgWriter_addFiles(t *testing.T) {
}
}
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 {
case "freebsd":
Expand Down
2 changes: 1 addition & 1 deletion smtp/smtp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1492,7 +1492,7 @@ func TestNewClient(t *testing.T) {
t.Run("new client via Dial fails on server not started", func(t *testing.T) {
_, err := Dial(fmt.Sprintf("%s:%d", TestServerAddr, 64000))
if err == nil {
t.Error("dial on non-existant server should fail")
t.Error("dial on non-existent server should fail")
}
})
t.Run("new client fails on server not available", func(t *testing.T) {
Expand Down

0 comments on commit 26f1ed3

Please sign in to comment.