1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-26 03:55:26 -05: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

@@ -4,11 +4,11 @@ import (
"testing"
. "v2ray.com/core/common/buf"
"v2ray.com/core/testing/assert"
. "v2ray.com/ext/assert"
)
func TestMultiBufferRead(t *testing.T) {
assert := assert.On(t)
assert := With(t)
b1 := New()
b1.AppendBytes('a', 'b')
@@ -19,17 +19,17 @@ func TestMultiBufferRead(t *testing.T) {
bs := make([]byte, 32)
nBytes, err := mb.Read(bs)
assert.Error(err).IsNil()
assert.Int(nBytes).Equals(4)
assert.Bytes(bs[:nBytes]).Equals([]byte("abcd"))
assert(err, IsNil)
assert(nBytes, Equals, 4)
assert(bs[:nBytes], Equals, []byte("abcd"))
}
func TestMultiBufferAppend(t *testing.T) {
assert := assert.On(t)
assert := With(t)
var mb MultiBuffer
b := New()
b.AppendBytes('a', 'b')
mb.Append(b)
assert.Int(mb.Len()).Equals(2)
assert(mb.Len(), Equals, 2)
}