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

Function TestContextGetOrNonExistentKey

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

Source from the content-addressed store, hash-verified

50}
51
52func TestContextGetOrNonExistentKey(t *testing.T) {
53 c := NewContext(nil, nil)
54
55 c.Set("key", int64(123))
56
57 v, err := ContextGetOr[int64](c, "nope", 999)
58 assert.NoError(t, err)
59 assert.Equal(t, int64(999), v)
60}
61
62func TestContextGetOrInvalidCast(t *testing.T) {
63 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…