mirror of
https://github.com/wneessen/go-mail.git
synced 2024-12-23 02:50:39 +01:00
Merge pull request #354 from wneessen/test_close_on_nil
Add test for closing a nil smtpclient
This commit is contained in:
commit
0f46ce800e
1 changed files with 9 additions and 0 deletions
|
@ -1647,6 +1647,15 @@ func TestClient_Close(t *testing.T) {
|
|||
t.Errorf("close was supposed to fail, but didn't")
|
||||
}
|
||||
})
|
||||
t.Run("close on a nil smtpclient should return nil", func(t *testing.T) {
|
||||
client, err := NewClient(DefaultHost)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create new client: %s", err)
|
||||
}
|
||||
if err = client.Close(); err != nil {
|
||||
t.Errorf("failed to close the client: %s", err)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestClient_DialWithContext(t *testing.T) {
|
||||
|
|
Loading…
Reference in a new issue