learning_go/testing/iterations/repeated_test.go
2025-12-20 09:59:10 +03:00

24 lines
337 B
Go

package main
import "testing"
func TestRepeat(t *testing.T) {
got := Repeat("a")
want := "aaaaa"
assertionCheck(t, got, want)
}
func BenchmarkRepeat(b *testing.B) {
for b.Loop() {
Repeat("a")
}
}
func assertionCheck(t testing.TB, got, want string) {
t.Helper()
if got != want {
t.Errorf("got %q want %q", got, want)
}
}