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

Delta Between Two Patch Sets: src/pkg/net/net_test.go

Issue 5294074: code review 5294074: src/pkg/[n-z]*: gofix -r error (Closed)
Left Patch Set: diff -r 2d06d4a5cb7f FAKE_REPOSITORY Created 13 years, 4 months ago
Right Patch Set: diff -r b78bb4f2d2a3 https://go.googlecode.com/hg/ Created 13 years, 4 months 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/net/net.go ('k') | src/pkg/net/newpollserver.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 net 5 package net
6 6
7 import ( 7 import (
8 "flag" 8 "flag"
9 "io" 9 "io"
10 "regexp" 10 "regexp"
11 "runtime"
11 "testing" 12 "testing"
12 ) 13 )
13 14
14 var runErrorTest = flag.Bool("run_error_test", false, "let TestDialError check f or dns errors") 15 var runErrorTest = flag.Bool("run_error_test", false, "let TestDialError check f or dns errors")
15 16
16 type DialErrorTest struct { 17 type DialErrorTest struct {
17 Net string 18 Net string
18 Raddr string 19 Raddr string
19 Pattern string 20 Pattern string
20 } 21 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 if e != nil && e.(*DNSError).Err != tt.ErrPrefix { 122 if e != nil && e.(*DNSError).Err != tt.ErrPrefix {
122 t.Errorf("#%d: expected %q, got %q (mismatched error)", i, tt.ErrPrefix, e.(*DNSError).Err) 123 t.Errorf("#%d: expected %q, got %q (mismatched error)", i, tt.ErrPrefix, e.(*DNSError).Err)
123 } 124 }
124 if a != tt.Reverse { 125 if a != tt.Reverse {
125 t.Errorf("#%d: expected %q, got %q (reverse address)", i , tt.Reverse, a) 126 t.Errorf("#%d: expected %q, got %q (reverse address)", i , tt.Reverse, a)
126 } 127 }
127 } 128 }
128 } 129 }
129 130
130 func TestShutdown(t *testing.T) { 131 func TestShutdown(t *testing.T) {
132 if runtime.GOOS == "plan9" {
133 return
134 }
131 l, err := Listen("tcp", "127.0.0.1:0") 135 l, err := Listen("tcp", "127.0.0.1:0")
132 if err != nil { 136 if err != nil {
133 if l, err = Listen("tcp6", "[::1]:0"); err != nil { 137 if l, err = Listen("tcp6", "[::1]:0"); err != nil {
134 t.Fatalf("ListenTCP on :0: %v", err) 138 t.Fatalf("ListenTCP on :0: %v", err)
135 } 139 }
136 } 140 }
137 141
138 go func() { 142 go func() {
139 c, err := l.Accept() 143 c, err := l.Accept()
140 if err != nil { 144 if err != nil {
(...skipping 21 matching lines...) Expand all
162 var buf [10]byte 166 var buf [10]byte
163 n, err := c.Read(buf[:]) 167 n, err := c.Read(buf[:])
164 if err != nil { 168 if err != nil {
165 t.Fatalf("client Read: %d, %v", n, err) 169 t.Fatalf("client Read: %d, %v", n, err)
166 } 170 }
167 got := string(buf[:n]) 171 got := string(buf[:n])
168 if got != "response" { 172 if got != "response" {
169 t.Errorf("read = %q, want \"response\"", got) 173 t.Errorf("read = %q, want \"response\"", got)
170 } 174 }
171 } 175 }
LEFTRIGHT

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