mirror of
https://github.com/wneessen/apg-go.git
synced 2024-11-22 05:40:51 +01:00
Winni Neessen
03867adac0
The previously named "AlgoUnsupported" has been replaced with "AlgoCoinflip" in the algorithm tests in algo_test.go. Additionally, the "AlgoUnsupported" test has been moved down to keep the test sequence logical and comprehensive.
24 lines
478 B
Go
24 lines
478 B
Go
package apg
|
|
|
|
import "testing"
|
|
|
|
func TestIntToAlgo(t *testing.T) {
|
|
tt := []struct {
|
|
name string
|
|
a int
|
|
e Algorithm
|
|
}{
|
|
{"AlgoPronouncable", 0, AlgoPronouncable},
|
|
{"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)
|
|
}
|
|
})
|
|
}
|
|
}
|