package nrandom_test import ( "fmt" "git.noahlan.cn/noahlan/ntool/nrandom" "git.noahlan.cn/noahlan/ntool/ntest/assert" "testing" "time" ) func TestRandInt(t *testing.T) { min, max := 1000, 9999 for i := 0; i < 5; i++ { val := nrandom.RandInt(min, max) fmt.Println(val) assert.True(t, val >= min) assert.True(t, val <= max) seed := time.Now().UnixNano() val = nrandom.RandIntWithSeed(min, max, seed) assert.True(t, val >= min) assert.True(t, val <= max) } }