github.com/aavshr/aws-sdk-go@v1.41.3/service/s3/s3crypto/key_handler_test.go (about) 1 package s3crypto 2 3 import ( 4 "testing" 5 ) 6 7 func TestGenerateBytes(t *testing.T) { 8 b, _ := generateBytes(5) 9 if e, a := 5, len(b); e != a { 10 t.Errorf("expected %d, but received %d", e, a) 11 } 12 b, _ = generateBytes(0) 13 if e, a := 0, len(b); e != a { 14 t.Errorf("expected %d, but received %d", e, a) 15 } 16 b, _ = generateBytes(1024) 17 if e, a := 1024, len(b); e != a { 18 t.Errorf("expected %d, but received %d", e, a) 19 } 20 }