mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
fix: fix the bug of random.RandFloats() infinite loop and the result of random.RandFloat() sometimes equals to max.
This commit is contained in:
1 parent
1f64e02df4
commit
2e5b9bc200
2 files changed
+21
-1
No files matched your search
@@ -197,6 +197,14 @@ func TestRandFloats(t *testing.T) {
|
||||
}
|
||||
|
||||
assert.Equal(len(numbers), 5)
|
||||
|
||||
numbers2 := RandFloats(10, 3.14, 3.2, 2)
|
||||
for _, n := range numbers2 {
|
||||
assert.GreaterOrEqual(n, 3.14)
|
||||
assert.Less(n, 3.2)
|
||||
}
|
||||
|
||||
assert.Equal(len(numbers2), 6)
|
||||
}
|
||||
|
||||
func TestRandIntSlice(t *testing.T) {
|
||||
|
||||
Reference in new issue
Block a user