From c4536d99d4d85036a2ef19f50cdebd07e4178233 Mon Sep 17 00:00:00 2001 From: v2ray Date: Wed, 15 Jun 2016 00:10:52 +0200 Subject: [PATCH] test case for raw connection --- transport/internet/tcp/connection_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 transport/internet/tcp/connection_test.go diff --git a/transport/internet/tcp/connection_test.go b/transport/internet/tcp/connection_test.go new file mode 100644 index 000000000..4fd435baa --- /dev/null +++ b/transport/internet/tcp/connection_test.go @@ -0,0 +1,19 @@ +package tcp_test + +import ( + "net" + "testing" + + "github.com/v2ray/v2ray-core/testing/assert" + . "github.com/v2ray/v2ray-core/transport/internet/tcp" +) + +func TestRawConnection(t *testing.T) { + assert := assert.On(t) + + rawConn := RawConnection{net.TCPConn{}} + assert.Bool(rawConn.Reusable()).IsFalse() + + rawConn.SetReusable(true) + assert.Bool(rawConn.Reusable()).IsFalse() +}