1
0
mirror of https://github.com/golang/go synced 2024-10-04 17:21:20 -06:00
go/src/net/netgo_unix_test.go
Mikio Hara f77e10fb2e net: simplify error messages in tests
This change simplifies unnecessarily redundant error messages in tests.
There's no need to worry any more because package APIs now return
consistent, self-descriptive error values.

Alos renames ambiguous test functions and makes use of test tables.

Change-Id: I7b61027607c4ae2a3cf605d08d58cf449fa27eb2
Reviewed-on: https://go-review.googlesource.com/9662
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
2015-05-06 09:25:08 +00:00

25 lines
527 B
Go

// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !cgo netgo
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
package net
import "testing"
func TestGoLookupIP(t *testing.T) {
host := "localhost"
_, err, ok := cgoLookupIP(host)
if ok {
t.Errorf("cgoLookupIP must be a placeholder")
}
if err != nil {
t.Error(err)
}
if _, err := goLookupIP(host); err != nil {
t.Error(err)
}
}