From fe795d5c00e128cacb60f9a63312e4c14e4c681a Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Tue, 25 Jun 2024 12:08:37 -0400 Subject: [PATCH] chore(ansi): add style benchmark test --- ansi/style_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ansi/style_test.go b/ansi/style_test.go index c946de12..924f323c 100644 --- a/ansi/style_test.go +++ b/ansi/style_test.go @@ -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() + } +}