MCPcopy
hub / github.com/labstack/echo / TestConcurrentRouter_Remove

Function TestConcurrentRouter_Remove

router_concurrent_test.go:17–31  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15)
16
17func TestConcurrentRouter_Remove(t *testing.T) {
18 router := NewConcurrentRouter(NewRouter(RouterConfig{}))
19
20 _, err := router.Add(Route{
21 Method: http.MethodGet,
22 Path: "/initial1",
23 Handler: handlerFunc,
24 })
25 assert.NoError(t, err)
26 assert.Equal(t, len(router.Routes()), 1)
27
28 err = router.Remove(http.MethodGet, "/initial1")
29 assert.NoError(t, err)
30 assert.Equal(t, len(router.Routes()), 0)
31}
32
33func TestConcurrentRouter_ConcurrentReads(t *testing.T) {
34 router := NewConcurrentRouter(NewRouter(RouterConfig{}))

Callers

nothing calls this directly

Calls 5

NewConcurrentRouterFunction · 0.85
NewRouterFunction · 0.85
AddMethod · 0.65
RoutesMethod · 0.65
RemoveMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…