Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(545)

Side by Side Diff: websocket/websocket_test.go

Issue 5672082: code review 5672082: go.net: gofix for net/url API changes. (Closed)
Patch Set: diff -r c31413e220a0 https://code.google.com/p/go.net Created 12 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « websocket/hybi_test.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package websocket 5 package websocket
6 6
7 import ( 7 import (
8 "bytes" 8 "bytes"
9 "fmt" 9 "fmt"
10 "io" 10 "io"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 func TestWithQuery(t *testing.T) { 158 func TestWithQuery(t *testing.T) {
159 once.Do(startServer) 159 once.Do(startServer)
160 160
161 client, err := net.Dial("tcp", serverAddr) 161 client, err := net.Dial("tcp", serverAddr)
162 if err != nil { 162 if err != nil {
163 t.Fatal("dialing", err) 163 t.Fatal("dialing", err)
164 } 164 }
165 165
166 config := newConfig(t, "/echo") 166 config := newConfig(t, "/echo")
167 » config.Location, err = url.ParseRequest(fmt.Sprintf("ws://%s/echo?q=v", serverAddr)) 167 » config.Location, err = url.ParseRequestURI(fmt.Sprintf("ws://%s/echo?q=v ", serverAddr))
168 if err != nil { 168 if err != nil {
169 t.Fatal("location url", err) 169 t.Fatal("location url", err)
170 } 170 }
171 171
172 ws, err := NewClient(config, client) 172 ws, err := NewClient(config, client)
173 if err != nil { 173 if err != nil {
174 t.Errorf("WebSocket handshake: %v", err) 174 t.Errorf("WebSocket handshake: %v", err)
175 return 175 return
176 } 176 }
177 ws.Close() 177 ws.Close()
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 n, err = conn.Read(second_msg) 265 n, err = conn.Read(second_msg)
266 if err != nil { 266 if err != nil {
267 t.Errorf("Read: %v", err) 267 t.Errorf("Read: %v", err)
268 } 268 }
269 second_msg = second_msg[0:n] 269 second_msg = second_msg[0:n]
270 if !bytes.Equal(msg[len(small_msg):], second_msg) { 270 if !bytes.Equal(msg[len(small_msg):], second_msg) {
271 t.Errorf("Echo: expected %q got %q", msg[len(small_msg):], secon d_msg) 271 t.Errorf("Echo: expected %q got %q", msg[len(small_msg):], secon d_msg)
272 } 272 }
273 conn.Close() 273 conn.Close()
274 } 274 }
OLDNEW
« no previous file with comments | « websocket/hybi_test.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b