iteration: add benchmark test

This commit is contained in:
vinchent 2024-09-10 13:23:32 +02:00
parent 917ce1638f
commit de5d9f39b6

View File

@ -10,3 +10,9 @@ func TestRepeat(t *testing.T) {
t.Errorf("expected %q but got %q", expected, repeated) t.Errorf("expected %q but got %q", expected, repeated)
} }
} }
func BenchmarkRepeat(b *testing.B) {
for i := 0; i < b.N; i++ {
Repeat("a")
}
}