1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-11-02 09:17:55 -04:00
v2fly/app/dns/nameserver_test.go

22 lines
384 B
Go
Raw Normal View History

2018-06-26 09:16:45 -04:00
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)
}