1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 18:17:52 -05:00
v2fly/common/net/timed_io_test.go

20 lines
418 B
Go
Raw Normal View History

2016-02-04 15:31:18 -05:00
package net_test
import (
"testing"
. "github.com/v2ray/v2ray-core/common/net"
"github.com/v2ray/v2ray-core/testing/assert"
)
func TestTimeOutSettings(t *testing.T) {
2016-05-24 15:55:46 -04:00
assert := assert.On(t)
2016-02-04 15:31:18 -05:00
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)
}