Skip to content

Commit

Permalink
test(path): Optimize unit test execution results (gin-gonic#3883)
Browse files Browse the repository at this point in the history
* test(path): Add a GC recycle validation

* test(path): Optimize unit test execution results

* test(path): Optimize unit test execution results
  • Loading branch information
flc1125 authored Mar 14, 2024
1 parent ee70b30 commit fd60a24
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
package gin

import (
"runtime"
"strings"
"testing"

Expand Down Expand Up @@ -80,6 +81,10 @@ func TestPathCleanMallocs(t *testing.T) {
t.Skip("skipping malloc count in short mode")
}

if runtime.GOMAXPROCS(0) > 1 {
t.Skip("skipping malloc count; GOMAXPROCS>1")
}

for _, test := range cleanTests {
allocs := testing.AllocsPerRun(100, func() { cleanPath(test.result) })
assert.EqualValues(t, allocs, 0)
Expand Down

0 comments on commit fd60a24

Please sign in to comment.