fix(test): resolve concurrent testing.T usage, upgrade dependencies, and clean format rules

This commit is contained in:
Harshal Patel 2026-06-05 23:19:30 +05:30 committed by Harshal Patel
parent 7a0e3d902f
commit ce65d64ef5

View File

@ -3958,15 +3958,26 @@ func BenchmarkGetMapFromFormData(b *testing.B) {
func TestWildcardParamUnicodeConcurrency(t *testing.T) {
router := New()
var mu sync.Mutex
var errs []string
router.GET("/user/:name", func(c *Context) {
name := c.Param("name")
assert.NotEmpty(t, name)
if name == "" {
mu.Lock()
errs = append(errs, "name param is empty")
mu.Unlock()
}
})
router.GET("/files/*filepath", func(c *Context) {
filepath := c.Param("filepath")
assert.NotEmpty(t, filepath)
if filepath == "" {
mu.Lock()
errs = append(errs, "filepath param is empty")
mu.Unlock()
}
})
var wg sync.WaitGroup
@ -3984,9 +3995,16 @@ func TestWildcardParamUnicodeConcurrency(t *testing.T) {
req, _ := http.NewRequest(http.MethodGet, p, nil)
w := httptest.NewRecorder()
router.ServeHTTP(w, req)
assert.Equal(t, http.StatusOK, w.Code)
if w.Code != http.StatusOK {
mu.Lock()
errs = append(errs, "status code is not 200")
mu.Unlock()
}
}
}()
}
wg.Wait()
assert.Empty(t, errs)
}