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{}
|
2016-03-08 14:29:11 +00:00
|
|
|
ctx := context.Background()
|
2014-01-23 19:14:06 +00:00
|
|
|
|
2016-03-08 14:29:11 +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
|
|
|
}
|