MCPcopy Index your code
hub / github.com/labstack/echo / TestContextGetNonExistentKey

Function TestContextGetNonExistentKey

context_generic_test.go:22–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20}
21
22func TestContextGetNonExistentKey(t *testing.T) {
23 c := NewContext(nil, nil)
24
25 c.Set("key", int64(123))
26
27 v, err := ContextGet[int64](c, "nope")
28 assert.ErrorIs(t, err, ErrNonExistentKey)
29 assert.Equal(t, int64(0), v)
30}
31
32func TestContextGetInvalidCast(t *testing.T) {
33 c := NewContext(nil, nil)

Callers

nothing calls this directly

Calls 2

SetMethod · 0.95
NewContextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…