mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -05:00
test case for timed io
This commit is contained in:
parent
77359d8047
commit
3a40fa67e1
20
common/net/timed_io_test.go
Normal file
20
common/net/timed_io_test.go
Normal file
@ -0,0 +1,20 @@
|
||||
package net_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
. "github.com/v2ray/v2ray-core/common/net"
|
||||
v2testing "github.com/v2ray/v2ray-core/testing"
|
||||
"github.com/v2ray/v2ray-core/testing/assert"
|
||||
)
|
||||
|
||||
func TestTimeOutSettings(t *testing.T) {
|
||||
v2testing.Current(t)
|
||||
|
||||
reader := NewTimeOutReader(8, nil)
|
||||
assert.Int(reader.GetTimeOut()).Equals(8)
|
||||
reader.SetTimeOut(8) // no op
|
||||
assert.Int(reader.GetTimeOut()).Equals(8)
|
||||
reader.SetTimeOut(9)
|
||||
assert.Int(reader.GetTimeOut()).Equals(9)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user