exercism-go/atbash-cipher/atbash_cipher_test.go
2025-03-09 13:26:08 -04:00

25 lines
447 B
Go

package atbash
import "testing"
func TestAtbash(t *testing.T) {
for _, test := range tests {
actual := Atbash(test.s)
if actual != test.expected {
t.Errorf("Atbash('%s'): expected '%s', actual '%s'", test.s, test.expected, actual)
}
}
}
func BenchmarkAtbash(b *testing.B) {
if testing.Short() {
b.Skip("skipping benchmark in short mode.")
}
for i := 0; i < b.N; i++ {
for _, test := range tests {
Atbash(test.s)
}
}
}