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.
This commit is contained in:
Winni Neessen 2024-09-20 10:30:30 +02:00
parent 508a2f2a6c
commit fcbd202595
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -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}