Files
go-easy-utils/mathUtil/rand_test.go
jeffery f97913a2bc Feature/math util (#22)
Development supports the math package
2023-04-12 11:10:07 +08:00

15 lines
274 B
Go

package mathUtil
import "testing"
func TestRand(t *testing.T) {
min := 1
max := 100
for i := 0; i < 1000; i++ {
num := Rand(min, max)
if num < min || num > max {
t.Errorf("randRange() returned %d, which is outside the range of [%d, %d]", num, min, max)
}
}
}