diff --git a/path_test.go b/path_test.go index c1e6ed4f..51bb7a3b 100644 --- a/path_test.go +++ b/path_test.go @@ -6,7 +6,6 @@ package gin import ( - "runtime" "testing" "github.com/stretchr/testify/assert" @@ -77,13 +76,17 @@ func TestPathCleanMallocs(t *testing.T) { if testing.Short() { t.Skip("skipping malloc count in short mode") } - if runtime.GOMAXPROCS(0) > 1 { - t.Log("skipping AllocsPerRun checks; GOMAXPROCS>1") - return - } for _, test := range cleanTests { allocs := testing.AllocsPerRun(100, func() { cleanPath(test.result) }) assert.EqualValues(t, allocs, 0) } } + +func BenchmarkPathClean(b *testing.B) { + for i := 0; i < b.N; i++ { + for _, test := range cleanTests { + cleanPath(test.path) + } + } +}