From 557691cb088e606f9490a65819ac78890ea757d5 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Sun, 12 Jan 2025 13:52:40 +0100 Subject: [PATCH 1/3] Bump package version to 0.6.1 --- doc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc.go b/doc.go index 3f1a7422..3d703d31 100644 --- a/doc.go +++ b/doc.go @@ -11,4 +11,4 @@ package mail // VERSION indicates the current version of the package. It is also attached to the default user // agent string. -const VERSION = "0.6.0" +const VERSION = "0.6.1" From aaf22bb495a17ce171b9ead9f58394c75e766f9e Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Sun, 12 Jan 2025 13:56:14 +0100 Subject: [PATCH 2/3] Fix typos in test case messages for server challenge assertions Corrected multiple occurrences of "challange" to "challenge" in test error messages within `smtp_test.go`. These changes improve clarity and ensure consistency in messaging for server challenge assertions. --- smtp/smtp_test.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/smtp/smtp_test.go b/smtp/smtp_test.go index ab083b6d..cc1187d3 100644 --- a/smtp/smtp_test.go +++ b/smtp/smtp_test.go @@ -382,7 +382,7 @@ func TestPlainAuth(t *testing.T) { } _, err = auth.Next([]byte("nonsense"), true) if err == nil { - t.Fatal("expected second server challange to fail") + t.Fatal("expected second server challenge to fail") } if !errors.Is(err, ErrUnexpectedServerChallange) { t.Errorf("expected error to be: %s, got: %s", ErrUnexpectedServerChallange, err) @@ -537,7 +537,7 @@ func TestPlainAuth_noEnc(t *testing.T) { } _, err = auth.Next([]byte("nonsense"), true) if err == nil { - t.Fatal("expected second server challange to fail") + t.Fatal("expected second server challenge to fail") } if !errors.Is(err, ErrUnexpectedServerChallange) { t.Errorf("expected error to be: %s, got: %s", ErrUnexpectedServerChallange, err) @@ -673,21 +673,21 @@ func TestLoginAuth(t *testing.T) { } resp, err := auth.Next([]byte(user), true) if err != nil { - t.Errorf("failed on first server challange: %s", err) + t.Errorf("failed on first server challenge: %s", err) } if !bytes.Equal([]byte(user), resp) { - t.Errorf("expected response to first challange to be: %q, got: %q", user, resp) + t.Errorf("expected response to first challenge to be: %q, got: %q", user, resp) } resp, err = auth.Next([]byte(pass), true) if err != nil { - t.Errorf("failed on second server challange: %s", err) + t.Errorf("failed on second server challenge: %s", err) } if !bytes.Equal([]byte(pass), resp) { - t.Errorf("expected response to second challange to be: %q, got: %q", pass, resp) + t.Errorf("expected response to second challenge to be: %q, got: %q", pass, resp) } _, err = auth.Next([]byte("nonsense"), true) if err == nil { - t.Error("expected third server challange to fail, but didn't") + t.Error("expected third server challenge to fail, but didn't") } if !errors.Is(err, ErrUnexpectedServerResponse) { t.Errorf("expected error to be: %s, got: %s", ErrUnexpectedServerResponse, err) @@ -821,21 +821,21 @@ func TestLoginAuth_noEnc(t *testing.T) { } resp, err := auth.Next([]byte(user), true) if err != nil { - t.Errorf("failed on first server challange: %s", err) + t.Errorf("failed on first server challenge: %s", err) } if !bytes.Equal([]byte(user), resp) { - t.Errorf("expected response to first challange to be: %q, got: %q", user, resp) + t.Errorf("expected response to first challenge to be: %q, got: %q", user, resp) } resp, err = auth.Next([]byte(pass), true) if err != nil { - t.Errorf("failed on second server challange: %s", err) + t.Errorf("failed on second server challenge: %s", err) } if !bytes.Equal([]byte(pass), resp) { - t.Errorf("expected response to second challange to be: %q, got: %q", pass, resp) + t.Errorf("expected response to second challenge to be: %q, got: %q", pass, resp) } _, err = auth.Next([]byte("nonsense"), true) if err == nil { - t.Error("expected third server challange to fail, but didn't") + t.Error("expected third server challenge to fail, but didn't") } if !errors.Is(err, ErrUnexpectedServerResponse) { t.Errorf("expected error to be: %s, got: %s", ErrUnexpectedServerResponse, err) @@ -920,14 +920,14 @@ func TestXOAuth2Auth(t *testing.T) { } resp, err := auth.Next([]byte("nonsense"), true) if err != nil { - t.Errorf("failed on first server challange: %s", err) + t.Errorf("failed on first server challenge: %s", err) } if !bytes.Equal([]byte(""), resp) { t.Errorf("expected server response to be empty, got: %q", resp) } _, err = auth.Next([]byte("nonsense"), false) if err != nil { - t.Errorf("failed on first server challange: %s", err) + t.Errorf("failed on first server challenge: %s", err) } }) t.Run("XOAuth2 succeeds with faker", func(t *testing.T) { From 47f46c5f1749b2c43ca20e34eadff8f79edbd145 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Sun, 12 Jan 2025 13:57:33 +0100 Subject: [PATCH 3/3] Fix typos in test error messages Corrects misspellings in test code from "occured" to "occurred" and "embeded" to "embedded" to improve readability and accuracy in test output. These changes do not affect functionality. --- msg_test.go | 2 +- senderror_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/msg_test.go b/msg_test.go index 28335190..bbe8703d 100644 --- a/msg_test.go +++ b/msg_test.go @@ -5890,7 +5890,7 @@ func TestMsg_WriteTo(t *testing.T) { t.Error("expected message to have multipart/related in mail body") } if !strings.Contains(buffer.String(), "embed.txt") { - t.Error("expected message to have embeded file in mail body") + t.Error("expected message to have embedded file in mail body") } }) t.Run("WriteTo with S/MIME signing fails with invalid key", func(t *testing.T) { diff --git a/senderror_test.go b/senderror_test.go index 1543f0f8..9dc8da54 100644 --- a/senderror_test.go +++ b/senderror_test.go @@ -311,7 +311,7 @@ func TestSendError_errorCode(t *testing.T) { } }) t.Run("errorCode with wrapper error", func(t *testing.T) { - code := errorCode(fmt.Errorf("an error occured: %w", errors.New("443 4.1.0 Server currently unavailable"))) + code := errorCode(fmt.Errorf("an error occurred: %w", errors.New("443 4.1.0 Server currently unavailable"))) if code != 443 { t.Errorf("expected error code: %d, got: %d", 443, code) }