MCPcopy
hub / github.com/gofiber/fiber / TestState_GetUint

Function TestState_GetUint

state_test.go:125–142  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

123}
124
125func TestState_GetUint(t *testing.T) {
126 t.Parallel()
127 st := newState()
128
129 st.Set("uint", uint(100))
130 u, ok := st.GetUint("uint")
131 require.True(t, ok)
132 require.Equal(t, uint(100), u)
133
134 st.Set("wrong", "not uint")
135 u, ok = st.GetUint("wrong")
136 require.False(t, ok)
137 require.Equal(t, uint(0), u)
138
139 u, ok = st.GetUint("missing")
140 require.False(t, ok)
141 require.Equal(t, uint(0), u)
142}
143
144func TestState_GetInt8(t *testing.T) {
145 t.Parallel()

Callers

nothing calls this directly

Calls 3

newStateFunction · 0.85
GetUintMethod · 0.80
SetMethod · 0.65

Tested by

no test coverage detected