summaryrefslogtreecommitdiff
path: root/vendor/github.com/mitchellh/packer/builder/azure/common/randomstring_test.go
blob: ce375e7b61d9d0d5df82abb02d795fd4c8dcfbef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See the LICENSE file in builder/azure for license information.

package common

import (
	"testing"
)

func TestRandomPassword_generates_15char_passwords(t *testing.T) {
	for i := 0; i < 100; i++ {
		pw := RandomPassword()
		t.Logf("pw: %v", pw)
		if len(pw) != 15 {
			t.Fatalf("len(pw)!=15, but %v: %v (%v)", len(pw), pw, i)
		}
	}
}