浏览代码

test case for raw connection

v2ray 9 年之前
父节点
当前提交
c4536d99d4
共有 1 个文件被更改,包括 19 次插入0 次删除
  1. 19 0
      transport/internet/tcp/connection_test.go

+ 19 - 0
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()
+}