1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-27 04:25:44 -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

@@ -5,11 +5,11 @@ import (
"time"
. "v2ray.com/core/common/protocol"
"v2ray.com/core/testing/assert"
. "v2ray.com/ext/assert"
)
func TestGenerateRandomInt64InRange(t *testing.T) {
assert := assert.On(t)
assert := With(t)
base := time.Now().Unix()
delta := 100
@@ -17,7 +17,7 @@ func TestGenerateRandomInt64InRange(t *testing.T) {
for i := 0; i < 100; i++ {
val := int64(generator())
assert.Int64(val).AtMost(base + int64(delta))
assert.Int64(val).AtLeast(base - int64(delta))
assert(val, AtMost, base + int64(delta))
assert(val, AtLeast, base - int64(delta))
}
}