1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-07-01 19:45:24 +00:00
v2fly/app/dns/nameserver_test.go
2018-06-26 15:16:45 +02:00

22 lines
384 B
Go

package dns_test
import (
"context"
"testing"
"time"
. "v2ray.com/core/app/dns"
. "v2ray.com/ext/assert"
)
func TestLocalNameServer(t *testing.T) {
assert := With(t)
s := NewLocalNameServer()
ctx, cancel := context.WithTimeout(context.Background(), time.Second*2)
ips, err := s.QueryIP(ctx, "google.com")
cancel()
assert(err, IsNil)
assert(len(ips), GreaterThan, 0)
}