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

Function TestContextGetOrOK

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

Source from the content-addressed store, hash-verified

40}
41
42func TestContextGetOrOK(t *testing.T) {
43 c := NewContext(nil, nil)
44
45 c.Set("key", int64(123))
46
47 v, err := ContextGetOr[int64](c, "key", 999)
48 assert.NoError(t, err)
49 assert.Equal(t, int64(123), v)
50}
51
52func TestContextGetOrNonExistentKey(t *testing.T) {
53 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…