From cf4d0146fbfbf5325655f3a940eaedb5cc0e3d82 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Thu, 21 Jan 2016 12:18:37 +0000 Subject: [PATCH] test case for domain dialing --- transport/dialer/dialer_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 transport/dialer/dialer_test.go diff --git a/transport/dialer/dialer_test.go b/transport/dialer/dialer_test.go new file mode 100644 index 00000000..634b2af2 --- /dev/null +++ b/transport/dialer/dialer_test.go @@ -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() +}