apg-go/algo_test.go
Winni Neessen fefb2557fc
Refactor spelling of "Pronounceable" and introduce syllable spelling feature
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.
2024-03-12 18:28:01 +01:00

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)
}
})
}
}