mirror of
https://github.com/golang/go
synced 2024-11-25 09:57:57 -07:00
net: minor fixes to test
R=golang-dev, r CC=golang-dev https://golang.org/cl/5707058
This commit is contained in:
parent
ee149d9a6b
commit
ecdd9f2376
@ -186,7 +186,7 @@ var duplicateErrorPattern = `dial (.*) dial (.*)`
|
||||
|
||||
func TestDialError(t *testing.T) {
|
||||
if !*runErrorTest {
|
||||
t.Logf("test disabled; use --run_error_test to enable")
|
||||
t.Logf("test disabled; use -run_error_test to enable")
|
||||
return
|
||||
}
|
||||
for i, tt := range dialErrorTests {
|
||||
|
@ -38,18 +38,18 @@ func testWriteToConn(t *testing.T, raddr string) {
|
||||
|
||||
_, err = c.(*UDPConn).WriteToUDP([]byte("Connection-oriented mode socket"), ra)
|
||||
if err == nil {
|
||||
t.Fatal("WriteToUDP should be failed")
|
||||
t.Fatal("WriteToUDP should fail")
|
||||
}
|
||||
if err != nil && err.(*OpError).Err != ErrWriteToConnected {
|
||||
t.Fatalf("WriteToUDP should be failed as ErrWriteToConnected: %v", err)
|
||||
t.Fatalf("WriteToUDP should fail as ErrWriteToConnected: %v", err)
|
||||
}
|
||||
|
||||
_, err = c.(*UDPConn).WriteTo([]byte("Connection-oriented mode socket"), ra)
|
||||
if err == nil {
|
||||
t.Fatal("WriteTo should be failed")
|
||||
t.Fatal("WriteTo should fail")
|
||||
}
|
||||
if err != nil && err.(*OpError).Err != ErrWriteToConnected {
|
||||
t.Fatalf("WriteTo should be failed as ErrWriteToConnected: %v", err)
|
||||
t.Fatalf("WriteTo should fail as ErrWriteToConnected: %v", err)
|
||||
}
|
||||
|
||||
_, err = c.Write([]byte("Connection-oriented mode socket"))
|
||||
@ -82,6 +82,6 @@ func testWriteToPacketConn(t *testing.T, raddr string) {
|
||||
|
||||
_, err = c.(*UDPConn).Write([]byte("Connection-less mode socket"))
|
||||
if err == nil {
|
||||
t.Fatal("Write should be failed")
|
||||
t.Fatal("Write should fail")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user