Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(path): Optimize unit test execution results #3883

Merged
merged 3 commits into from
Mar 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test(path): Add a GC recycle validation
  • Loading branch information
flc1125 committed Mar 12, 2024
commit baf4c15e419a7365136cc85f3dc6e64369300539
3 changes: 3 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,8 @@ func TestPathCleanMallocs(t *testing.T) {
t.Skip("skipping malloc count in short mode")
}

runtime.GC()

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