mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-18 02:16:10 -05:00
22 lines
384 B
Go
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)
|
||
|
}
|