MCPcopy
hub / github.com/gin-gonic/gin / TestPathCleanMallocs

Function TestPathCleanMallocs

path_test.go:79–92  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

77}
78
79func TestPathCleanMallocs(t *testing.T) {
80 if testing.Short() {
81 t.Skip("skipping malloc count in short mode")
82 }
83
84 if runtime.GOMAXPROCS(0) > 1 {
85 t.Skip("skipping malloc count; GOMAXPROCS>1")
86 }
87
88 for _, test := range cleanTests {
89 allocs := testing.AllocsPerRun(100, func() { cleanPath(test.result) })
90 assert.InDelta(t, 0, allocs, 0.01)
91 }
92}
93
94func BenchmarkPathClean(b *testing.B) {
95 b.ReportAllocs()

Callers

nothing calls this directly

Calls 1

cleanPathFunction · 0.85

Tested by

no test coverage detected