summaryrefslogtreecommitdiff
path: root/src/pkg/websocket/websocket_test.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-03-30 10:51:11 -0700
committerRuss Cox <rsc@golang.org>2010-03-30 10:51:11 -0700
commita4d61cffa679cee2c85de18f115d754727a127cd (patch)
tree8b338a7affb56cf4142d66f8a8cd691366fdf7d1 /src/pkg/websocket/websocket_test.go
parent68643f292414be8ca1b95a2f6e85e1fb64876cf3 (diff)
downloadgolang-a4d61cffa679cee2c85de18f115d754727a127cd.tar.gz
simplify various code using new map index rule
R=r CC=golang-dev http://codereview.appspot.com/833044
Diffstat (limited to 'src/pkg/websocket/websocket_test.go')
-rw-r--r--src/pkg/websocket/websocket_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pkg/websocket/websocket_test.go b/src/pkg/websocket/websocket_test.go
index 58065580e..0762fca69 100644
--- a/src/pkg/websocket/websocket_test.go
+++ b/src/pkg/websocket/websocket_test.go
@@ -42,18 +42,18 @@ func TestEcho(t *testing.T) {
ws, err := newClient("/echo", "localhost", "http://localhost",
"ws://localhost/echo", "", client, handshake)
if err != nil {
- t.Errorf("WebSocket handshake error", err)
+ t.Errorf("WebSocket handshake error: %v", err)
return
}
msg := []byte("hello, world\n")
if _, err := ws.Write(msg); err != nil {
- t.Errorf("Write: error %v", err)
+ t.Errorf("Write: %v", err)
}
var actual_msg = make([]byte, 512)
n, err := ws.Read(actual_msg)
if err != nil {
- t.Errorf("Read: error %v", err)
+ t.Errorf("Read: %v", err)
}
actual_msg = actual_msg[0:n]
if !bytes.Equal(msg, actual_msg) {
@@ -73,7 +73,7 @@ func TestEchoDraft75(t *testing.T) {
ws, err := newClient("/echoDraft75", "localhost", "http://localhost",
"ws://localhost/echoDraft75", "", client, draft75handshake)
if err != nil {
- t.Errorf("WebSocket handshake error", err)
+ t.Errorf("WebSocket handshake: %v", err)
return
}
@@ -104,7 +104,7 @@ func TestWithQuery(t *testing.T) {
ws, err := newClient("/echo?q=v", "localhost", "http://localhost",
"ws://localhost/echo?q=v", "", client, handshake)
if err != nil {
- t.Errorf("WebSocket handshake error", err)
+ t.Errorf("WebSocket handshake: %v", err)
return
}
ws.Close()