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

Side by Side Diff: src/pkg/net/hosts_test.go

Issue 4631098: code review 4631098: sort: rename helpers: s/Sort// in sort.Sort[Float64s|In... (Closed)
Patch Set: diff -r e276ba524959 https://go.googlecode.com/hg/ Created 12 years, 8 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:
View unified diff | Download patch
« no previous file with comments | « src/pkg/index/suffixarray/suffixarray_test.go ('k') | src/pkg/path/filepath/match.go » ('j') | 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 net 5 package net
6 6
7 import ( 7 import (
8 "sort" 8 "sort"
9 "testing" 9 "testing"
10 ) 10 )
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 hostsPath = p 53 hostsPath = p
54 } 54 }
55 55
56 func TestLookupHost(t *testing.T) { 56 func TestLookupHost(t *testing.T) {
57 // Can't depend on this to return anything in particular, 57 // Can't depend on this to return anything in particular,
58 // but if it does return something, make sure it doesn't 58 // but if it does return something, make sure it doesn't
59 // duplicate addresses (a common bug due to the way 59 // duplicate addresses (a common bug due to the way
60 // getaddrinfo works). 60 // getaddrinfo works).
61 addrs, _ := LookupHost("localhost") 61 addrs, _ := LookupHost("localhost")
62 » sort.SortStrings(addrs) 62 » sort.Strings(addrs)
63 for i := 0; i+1 < len(addrs); i++ { 63 for i := 0; i+1 < len(addrs); i++ {
64 if addrs[i] == addrs[i+1] { 64 if addrs[i] == addrs[i+1] {
65 t.Fatalf("LookupHost(\"localhost\") = %v, has duplicate addresses", addrs) 65 t.Fatalf("LookupHost(\"localhost\") = %v, has duplicate addresses", addrs)
66 } 66 }
67 } 67 }
68 } 68 }
OLDNEW
« no previous file with comments | « src/pkg/index/suffixarray/suffixarray_test.go ('k') | src/pkg/path/filepath/match.go » ('j') | no next file with comments »

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