From fcbd202595a4611baa1621a684d9baf30512b923 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Fri, 20 Sep 2024 10:30:30 +0200 Subject: [PATCH] Add test for IsTemp method on nil SendError This commit introduces a new test case to verify the behavior of the IsTemp method when called on a nil SendError instance. It ensures that the method returns false as expected, improving test coverage for edge cases. --- senderror_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/senderror_test.go b/senderror_test.go index e83df00..789b290 100644 --- a/senderror_test.go +++ b/senderror_test.go @@ -83,6 +83,13 @@ func TestSendError_IsTemp(t *testing.T) { } } +func TestSendError_IsTempNil(t *testing.T) { + var se *SendError + if se.IsTemp() { + t.Error("expected false on nil-senderror") + } +} + // returnSendError is a helper method to retunr a SendError with a specific reason func returnSendError(r SendErrReason, t bool) error { return &SendError{Reason: r, isTemp: t}