exercism-go/bob/bob_test.go
2025-03-09 13:26:08 -04:00

28 lines
481 B
Go

package bob
import "testing"
func TestHey(t *testing.T) {
for _, tt := range testCases {
actual := Hey(tt.input)
if actual != tt.expected {
msg := `
ALICE (%s): %q
BOB: %s
Expected Bob to respond: %s`
t.Fatalf(msg, tt.description, tt.input, actual, tt.expected)
}
}
}
func BenchmarkHey(b *testing.B) {
if testing.Short() {
b.Skip("skipping benchmark in short mode.")
}
for i := 0; i < b.N; i++ {
for _, tt := range testCases {
Hey(tt.input)
}
}
}