mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
384 B
22 lines
384 B
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)
|
|
}
|