go-socks5/resolver_test.go

19 lines
322 B
Go
Raw Normal View History

2014-01-23 19:14:06 +00:00
package socks5
import (
2020-04-19 09:08:22 +00:00
"context"
2014-01-23 19:14:06 +00:00
"testing"
2020-08-05 06:40:07 +00:00
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
2014-01-23 19:14:06 +00:00
)
func TestDNSResolver(t *testing.T) {
d := DNSResolver{}
ctx := context.Background()
2014-01-23 19:14:06 +00:00
_, addr, err := d.Resolve(ctx, "localhost")
2020-08-05 06:40:07 +00:00
require.NoError(t, err)
assert.True(t, addr.IsLoopback())
2014-01-23 19:14:06 +00:00
}