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:
parent
3c63425516
commit
ec12c1d7bc
1 changed files with 4 additions and 4 deletions
|
|
@ -550,11 +550,11 @@ func TestWSDialWriteHandshakeError(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := WSDial("ws://127.0.0.1:9999/socket")
|
_, err := WSDial("ws://127.0.0.1:9999/socket")
|
||||||
if err == nil || (!strings.Contains(err.Error(), "write handshake") && !strings.Contains(err.Error(), "set deadline")) {
|
if err == nil {
|
||||||
t.Errorf("expected 'write handshake' or 'set deadline' in error, got: %v", err)
|
t.Error("expected connection error")
|
||||||
}
|
}
|
||||||
if !strings.Contains(err.Error(), "write handshake") {
|
if !strings.Contains(err.Error(), "write handshake") && !strings.Contains(err.Error(), "set deadline") {
|
||||||
t.Errorf("expected 'write handshake' in error, got: %v", err)
|
t.Errorf("expected 'write handshake' or 'set deadline' in error, got: %v", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue