1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-29 15:26:29 -04:00
v2fly/app/dns/nameserver_local_test.go
Ye Zhihao d8c03f10b5
Refactoring: DNS App (#169)
Co-authored-by: loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
2020-12-18 17:24:33 +08:00

26 lines
483 B
Go

package dns_test
import (
"context"
"testing"
"time"
. "v2ray.com/core/app/dns"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
)
func TestLocalNameServer(t *testing.T) {
s := NewLocalNameServer()
ctx, cancel := context.WithTimeout(context.Background(), time.Second*2)
ips, err := s.QueryIP(ctx, "google.com", net.IP{}, IPOption{
IPv4Enable: true,
IPv6Enable: true,
})
cancel()
common.Must(err)
if len(ips) == 0 {
t.Error("expect some ips, but got 0")
}
}