Files
netmaker/netclient/ncutils/netclientutils_test.go
john s d1fb0b90af netclient: math.Rand -> crypto.Rand (#956)
* netclient: math.Rand -> crypto.Rand

Signed-off-by: John Sahhar <john@gravitl.com>

* netclient: math.Rand -> crypto.Rand

* add tests

Signed-off-by: John Sahhar <john@gravitl.com>

* netclient: math.Rand -> crypto.Rand

* add test

Signed-off-by: John Sahhar <john@gravitl.com>
2022-03-23 12:06:26 -06:00

16 lines
435 B
Go

package ncutils
import "testing"
func TestMakeRandomString(t *testing.T) {
for testCase := 0; testCase < 100; testCase++ {
for size := 2; size < 2058; size++ {
if length := len(MakeRandomString(size)); length != size {
t.Fatalf("expected random string of size %d, got %d instead", size, length)
}
}
}
}