From a94e5008a272fdd2d1b0d10c149d656292f6eee2 Mon Sep 17 00:00:00 2001 From: kiyon Date: Wed, 14 Oct 2020 15:48:31 +0800 Subject: [PATCH] Get rid of parallel benchmark --- ansi/buffer_test.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ansi/buffer_test.go b/ansi/buffer_test.go index 99d1e4d..1a45044 100644 --- a/ansi/buffer_test.go +++ b/ansi/buffer_test.go @@ -21,11 +21,9 @@ func BenchmarkPrintableRuneWidth(b *testing.B) { b.ReportAllocs() b.ResetTimer() - b.RunParallel(func(pb *testing.PB) { - for pb.Next() { - n = PrintableRuneWidth(s) - } - }) + for i := 0; i < b.N; i++ { + n = PrintableRuneWidth(s) + } if n != 3 { b.Fatalf("width should be 3, got %d", n)