fix(imapx): honor context in Connect with bounded dial retry
This commit is contained in:
@@ -40,3 +40,12 @@ func TestTestLoginListsFolders(t *testing.T) {
|
||||
t.Fatalf("INBOX not in folders: %v", folders)
|
||||
}
|
||||
}
|
||||
|
||||
func TestConnectHonorsCancelledContext(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
cancel()
|
||||
_, err := Connect(ctx, Endpoint{Host: "10.255.255.1", Port: 993, TLSMode: "ssl"})
|
||||
if err == nil {
|
||||
t.Fatal("expected error for cancelled context")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user