apg-go/algo_test.go
Winni Neessen 03867adac0
Replace AlgoUnsupported with AlgoCoinflip in algo_test.go
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.
2024-03-07 21:22:14 +01:00

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