Skip to content

Commit

Permalink
chore(ansi): add style benchmark test
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Jun 25, 2024
1 parent de32bb7 commit fe795d5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ansi/style_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,11 @@ func TestColorColor(t *testing.T) {
t.Errorf("Unexpected sequence: %q", s)
}
}

func BenchmarkStyle(b *testing.B) {
s := ansi.Style{}.Bold().Underline().ForegroundColor(color.RGBA{255, 255, 255, 255})
b.ReportAllocs()
for i := 0; i < b.N; i++ {
_ = s.String()
}
}

0 comments on commit fe795d5

Please sign in to comment.