From baf4c15e419a7365136cc85f3dc6e64369300539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Flc=E3=82=9B?= Date: Tue, 12 Mar 2024 14:06:51 +0800 Subject: [PATCH] test(path): Add a GC recycle validation --- path_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/path_test.go b/path_test.go index caefd63a..f7ba7566 100644 --- a/path_test.go +++ b/path_test.go @@ -6,6 +6,7 @@ package gin import ( + "runtime" "strings" "testing" @@ -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)