1
0

resolver_test.go 310 B

123456789101112131415161718192021
  1. package socks5
  2. import (
  3. "testing"
  4. "golang.org/x/net/context"
  5. )
  6. func TestDNSResolver(t *testing.T) {
  7. d := DNSResolver{}
  8. ctx := context.Background()
  9. _, addr, err := d.Resolve(ctx, "localhost")
  10. if err != nil {
  11. t.Fatalf("err: %v", err)
  12. }
  13. if !addr.IsLoopback() {
  14. t.Fatalf("expected loopback")
  15. }
  16. }