test case for domain dialing

pull/73/head
Darien Raymond 2016-01-21 12:18:37 +00:00
parent 8180145413
commit cf4d0146fb
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
package dialer_test
import (
"testing"
v2net "github.com/v2ray/v2ray-core/common/net"
v2testing "github.com/v2ray/v2ray-core/testing"
"github.com/v2ray/v2ray-core/testing/assert"
. "github.com/v2ray/v2ray-core/transport/dialer"
)
func TestDialDomain(t *testing.T) {
v2testing.Current(t)
conn, err := Dial(v2net.TCPDestination(v2net.DomainAddress("google.com"), 443))
assert.Error(err).IsNil()
assert.StringLiteral(conn.RemoteAddr().Network()).Equals("tcp")
conn.Close()
}