github.com/yoctocloud/packer@v0.6.2-0.20160520224004-e11a0a18423f/builder/azure/common/randomstring_test.go (about) 1 // Copyright (c) Microsoft Corporation. All rights reserved. 2 // Licensed under the MIT License. See the LICENSE file in builder/azure for license information. 3 4 package common 5 6 import ( 7 "testing" 8 ) 9 10 func TestRandomPassword_generates_15char_passwords(t *testing.T) { 11 for i := 0; i < 100; i++ { 12 pw := RandomPassword() 13 t.Logf("pw: %v", pw) 14 if len(pw) != 15 { 15 t.Fatalf("len(pw)!=15, but %v: %v (%v)", len(pw), pw, i) 16 } 17 } 18 }