test: fix TestWSDialWriteHandshakeError assertion

Remove duplicate assertion that expected only 'write handshake' error.
After SetDeadline error checking improvements, closed connections now
properly return 'set deadline' errors instead of proceeding to write.

Test now accepts both error types as valid.
This commit is contained in:
Graham McIntire 2026-03-24 09:16:17 -05:00
parent 3c63425516
commit ec12c1d7bc
No known key found for this signature in database

View file

@ -550,11 +550,11 @@ func TestWSDialWriteHandshakeError(t *testing.T) {
}
_, err := WSDial("ws://127.0.0.1:9999/socket")
if err == nil || (!strings.Contains(err.Error(), "write handshake") && !strings.Contains(err.Error(), "set deadline")) {
t.Errorf("expected 'write handshake' or 'set deadline' in error, got: %v", err)
if err == nil {
t.Error("expected connection error")
}
if !strings.Contains(err.Error(), "write handshake") {
t.Errorf("expected 'write handshake' in error, got: %v", err)
if !strings.Contains(err.Error(), "write handshake") && !strings.Contains(err.Error(), "set deadline") {
t.Errorf("expected 'write handshake' or 'set deadline' in error, got: %v", err)
}
}