1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

refactor: rewrite all unit test functions with assert

This commit is contained in:
dudaodong
2022-01-09 14:01:51 +08:00
parent 25b2ae6b98
commit 642d0b8077

View File

@@ -31,14 +31,14 @@ func TestRandInt(t *testing.T) {
assert := internal.NewAssert(t, "TestRandInt")
r1 := RandInt(1, 10)
assert.Greater(r1, 1)
assert.GreaterOrEqual(r1, 1)
assert.Less(r1, 10)
r2 := RandInt(1, 1)
assert.Equal(1, r2)
r3 := RandInt(10, 1)
assert.Greater(r1, 1)
assert.GreaterOrEqual(r1, 1)
assert.Less(r3, 10)
}
@@ -53,4 +53,5 @@ func TestRandBytes(t *testing.T) {
assert.Equal(reflect.Slice, v.Kind())
assert.Equal(reflect.Uint8, elemType.Kind())
assert.Equal([]byte{}, RandBytes(0))
}