Skip to content

Commit

Permalink
Add test for invalid SMTPAuthType
Browse files Browse the repository at this point in the history
Introduce a new test case to verify that `UnmarshalString` fails when given an invalid string. This ensures the robustness of the error handling in the `SMTPAuthType` unmarshalling process.
  • Loading branch information
wneessen committed Oct 21, 2024
1 parent bf44fd2 commit 09133ef
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,10 @@ func TestSMTPAuthType_UnmarshalString(t *testing.T) {
}
})
}
t.Run("should fail", func(t *testing.T) {
var authType SMTPAuthType
if err := authType.UnmarshalString("invalid"); err == nil {
t.Error("UnmarshalString() should have failed")
}
})
}

0 comments on commit 09133ef

Please sign in to comment.