|
|
@ -222,7 +222,6 @@ func TestProtocolHandshake(t *testing.T) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func TestProtocolHandshakeErrors(t *testing.T) { |
|
|
|
func TestProtocolHandshakeErrors(t *testing.T) { |
|
|
|
our := &protoHandshake{Version: 3, Caps: []Cap{{"foo", 2}, {"bar", 3}}, Name: "quux"} |
|
|
|
|
|
|
|
tests := []struct { |
|
|
|
tests := []struct { |
|
|
|
code uint64 |
|
|
|
code uint64 |
|
|
|
msg interface{} |
|
|
|
msg interface{} |
|
|
@ -258,7 +257,7 @@ func TestProtocolHandshakeErrors(t *testing.T) { |
|
|
|
for i, test := range tests { |
|
|
|
for i, test := range tests { |
|
|
|
p1, p2 := MsgPipe() |
|
|
|
p1, p2 := MsgPipe() |
|
|
|
go Send(p1, test.code, test.msg) |
|
|
|
go Send(p1, test.code, test.msg) |
|
|
|
_, err := readProtocolHandshake(p2, our) |
|
|
|
_, err := readProtocolHandshake(p2) |
|
|
|
if !reflect.DeepEqual(err, test.err) { |
|
|
|
if !reflect.DeepEqual(err, test.err) { |
|
|
|
t.Errorf("test %d: error mismatch: got %q, want %q", i, err, test.err) |
|
|
|
t.Errorf("test %d: error mismatch: got %q, want %q", i, err, test.err) |
|
|
|
} |
|
|
|
} |
|
|
|