1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-07-14 05:00:13 -04:00

fully migrate to new assertion lib

This commit is contained in:
Darien Raymond
2017-10-24 16:15:35 +02:00
parent 4a0ca30d08
commit 74cf833758
70 changed files with 974 additions and 942 deletions

View File

@@ -5,7 +5,7 @@ import (
"testing"
"time"
"v2ray.com/core/testing/assert"
. "v2ray.com/ext/assert"
. "v2ray.com/core/transport/internet/kcp"
)
@@ -51,15 +51,15 @@ func (o *NoOpConn) SetWriteDeadline(time.Time) error {
func (o *NoOpConn) Reset(input func([]Segment)) {}
func TestConnectionReadTimeout(t *testing.T) {
assert := assert.On(t)
assert := With(t)
conn := NewConnection(1, &NoOpConn{}, &Config{})
conn.SetReadDeadline(time.Now().Add(time.Second))
b := make([]byte, 1024)
nBytes, err := conn.Read(b)
assert.Int(nBytes).Equals(0)
assert.Error(err).IsNotNil()
assert(nBytes, Equals, 0)
assert(err, IsNotNil)
conn.Terminate()
}