1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-23 02:26:49 -05:00
v2fly/common/net/timed_io_test.go

20 lines
401 B
Go
Raw Normal View History

2016-02-04 15:31:18 -05:00
package net_test
import (
"testing"
2016-08-20 14:55:45 -04:00
. "v2ray.com/core/common/net"
"v2ray.com/core/testing/assert"
2016-02-04 15:31:18 -05:00
)
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)
2016-08-25 15:55:49 -04:00
assert.Uint32(reader.GetTimeOut()).Equals(8)
2016-02-04 15:31:18 -05:00
reader.SetTimeOut(8) // no op
2016-08-25 15:55:49 -04:00
assert.Uint32(reader.GetTimeOut()).Equals(8)
2016-02-04 15:31:18 -05:00
reader.SetTimeOut(9)
2016-08-25 15:55:49 -04:00
assert.Uint32(reader.GetTimeOut()).Equals(9)
2016-02-04 15:31:18 -05:00
}