diff --git a/context_test.go b/context_test.go index b4463d93..1a014cb5 100644 --- a/context_test.go +++ b/context_test.go @@ -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) }