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

Function TestState_GetInt8

state_test.go:144–161  ·  state_test.go::TestState_GetInt8
(t *testing.T)

Source from the content-addressed store, hash-verified

142}
143
144func TestState_GetInt8(t *testing.T) {
145 t.Parallel()
146 st := newState()
147
148 st.Set("int8", int8(10))
149 i, ok := st.GetInt8("int8")
150 require.True(t, ok)
151 require.Equal(t, int8(10), i)
152
153 st.Set("wrong", "not int8")
154 i, ok = st.GetInt8("wrong")
155 require.False(t, ok)
156 require.Equal(t, int8(0), i)
157
158 i, ok = st.GetInt8("missing")
159 require.False(t, ok)
160 require.Equal(t, int8(0), i)
161}
162
163func TestState_GetInt16(t *testing.T) {
164 t.Parallel()

Callers

nothing calls this directly

Calls 3

newStateFunction · 0.85
GetInt8Method · 0.80
SetMethod · 0.65

Tested by

no test coverage detected