Skip to content

Commit

Permalink
fix(term): correct StringWidth benchmark test
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Mar 13, 2024
1 parent 7fedce4 commit 8cc69f8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions exp/term/ansi/width_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ func TestStringWidth(t *testing.T) {
}

func BenchmarkStringWidth(b *testing.B) {
for _, c := range cases {
for i := 0; i < b.N; i++ {
StringWidth(c.input)
b.RunParallel(func(pb *testing.PB) {
b.ReportAllocs()
b.ResetTimer()
for pb.Next() {
StringWidth("foo")
}
}
})
}

0 comments on commit 8cc69f8

Please sign in to comment.