2013-12-18 15:40:10 -07:00
|
|
|
// 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
|
2014-03-02 15:09:28 -07:00
|
|
|
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
|
2013-12-18 15:40:10 -07:00
|
|
|
|
|
|
|
package net
|
|
|
|
|
2016-04-14 18:47:25 -06:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
|
|
|
)
|
2013-12-18 15:40:10 -07:00
|
|
|
|
|
|
|
func TestGoLookupIP(t *testing.T) {
|
|
|
|
host := "localhost"
|
2016-05-08 19:17:59 -06:00
|
|
|
ctx := context.Background()
|
|
|
|
_, err, ok := cgoLookupIP(ctx, host)
|
2013-12-18 15:40:10 -07:00
|
|
|
if ok {
|
|
|
|
t.Errorf("cgoLookupIP must be a placeholder")
|
|
|
|
}
|
|
|
|
if err != nil {
|
2015-04-30 21:38:42 -06:00
|
|
|
t.Error(err)
|
2013-12-18 15:40:10 -07:00
|
|
|
}
|
2016-11-01 22:01:08 -06:00
|
|
|
if _, err := DefaultResolver.goLookupIP(ctx, host); err != nil {
|
2015-04-30 21:38:42 -06:00
|
|
|
t.Error(err)
|
2013-12-18 15:40:10 -07:00
|
|
|
}
|
|
|
|
}
|