MCPcopy
hub / github.com/julienschmidt/httprouter / TestPathCleanMallocs

Function TestPathCleanMallocs

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

Source from the content-addressed store, hash-verified

76}
77
78func TestPathCleanMallocs(t *testing.T) {
79 if testing.Short() {
80 t.Skip("skipping malloc count in short mode")
81 }
82 if runtime.GOMAXPROCS(0) > 1 {
83 t.Log("skipping AllocsPerRun checks; GOMAXPROCS>1")
84 return
85 }
86
87 for _, test := range cleanTests {
88 allocs := testing.AllocsPerRun(100, func() { CleanPath(test.result) })
89 if allocs > 0 {
90 t.Errorf("CleanPath(%q): %v allocs, want zero", test.result, allocs)
91 }
92 }
93}

Callers

nothing calls this directly

Calls 1

CleanPathFunction · 0.85

Tested by

no test coverage detected