mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
465 B
21 lines
465 B
9 years ago
|
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)
|
||
|
}
|