github.com/StackPointCloud/packer@v0.10.2-0.20180716202532-b28098e0f79b/builder/azure/common/randomstring_test.go (about) 1 package common 2 3 import ( 4 "testing" 5 ) 6 7 func TestRandomPassword_generates_15char_passwords(t *testing.T) { 8 for i := 0; i < 100; i++ { 9 pw := RandomPassword() 10 t.Logf("pw: %v", pw) 11 if len(pw) != 15 { 12 t.Fatalf("len(pw)!=15, but %v: %v (%v)", len(pw), pw, i) 13 } 14 } 15 }