package main
import "testing"
func TestRandom(t *testing.T) {
cases := []int{1, 1023, 1024, 1025, 4095, 4096, 4097}
for _, c := range cases {
var bytes []byte
Random(c, []byte{'A'}, func(res []byte) {
bytes = append(bytes, res...)
})
if len(bytes) != c {
t.Errorf("expected %d bytes, got %d", c, len(bytes))
}
}
}