mirror of
https://github.com/asmogo/nws.git
synced 2024-12-13 02:46:22 +00:00
22 lines
293 B
Go
22 lines
293 B
Go
|
package socks5
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"context"
|
||
|
)
|
||
|
|
||
|
func TestDNSResolver(t *testing.T) {
|
||
|
d := DNSResolver{}
|
||
|
ctx := context.Background()
|
||
|
|
||
|
_, addr, err := d.Resolve(ctx, "localhost")
|
||
|
if err != nil {
|
||
|
t.Fatalf("err: %v", err)
|
||
|
}
|
||
|
|
||
|
if !addr.IsLoopback() {
|
||
|
t.Fatalf("expected loopback")
|
||
|
}
|
||
|
}
|