chore: removed unused variable and updated TestUpdateRouteTreesCalledOnce testcase

This commit is contained in:
pawannn 2025-11-10 00:17:13 +05:30
parent 12600156ae
commit 232172b7e4

View File

@ -93,19 +93,15 @@ func TestUpdateRouteTreesCalledOnce(t *testing.T) {
SetMode(TestMode)
router := New()
callCount := 0
originalUpdate := router.updateRouteTrees
router.GET(`/test\:action`, func(c *Context) {
c.JSON(http.StatusOK, H{"call": callCount})
c.String(http.StatusOK, "ok")
})
for i := 0; i < 5; i++ {
for range 5 {
w := httptest.NewRecorder()
req, _ := http.NewRequest(http.MethodGet, "/test:action", nil)
router.ServeHTTP(w, req)
assert.Equal(t, http.StatusOK, w.Code)
assert.Equal(t, "ok", w.Body.String())
}
_ = originalUpdate
}