mirror of
https://github.com/wneessen/apg-go.git
synced 2024-11-22 05:40:51 +01:00
Winni Neessen
fefb2557fc
The spelling of "Pronounceable" has been adjusted throughout the code. Moreover, a new functionality for producing pronounceable passwords spelled as correlating syllables has been integrated. This includes relevant changes to password character sets used for pronounceable passwords and enhancements to test this new feature.
24 lines
480 B
Go
24 lines
480 B
Go
package apg
|
|
|
|
import "testing"
|
|
|
|
func TestIntToAlgo(t *testing.T) {
|
|
tt := []struct {
|
|
name string
|
|
a int
|
|
e Algorithm
|
|
}{
|
|
{"AlgoPronounceable", 0, AlgoPronounceable},
|
|
{"AlgoRandom", 1, AlgoRandom},
|
|
{"AlgoCoinflip", 2, AlgoCoinFlip},
|
|
{"AlgoUnsupported", 3, AlgoUnsupported},
|
|
}
|
|
for _, tc := range tt {
|
|
t.Run(tc.name, func(t *testing.T) {
|
|
a := IntToAlgo(tc.a)
|
|
if a != tc.e {
|
|
t.Errorf("IntToAlgo() failed, expected: %d, got: %d", tc.e, a)
|
|
}
|
|
})
|
|
}
|
|
}
|