1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
11 type hostTest struct {
17 var hosttests = []hostTest{
35 func TestLookupStaticHost(t *testing.T) {
37 hostsPath = "hosts_testdata"
38 for i := 0; i < len(hosttests); i++ {
40 ips := lookupStaticHost(tt.host)
41 if len(ips) != len(tt.ips) {
42 t.Errorf("# of hosts = %v; want %v",
43 len(ips), len(tt.ips))
46 for k, v := range ips {
47 if tt.ips[k].String() != v {
48 t.Errorf("lookupStaticHost(%q) = %v; want %v",
49 tt.host, v, tt.ips[k])