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

Function TestState_Len

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

Source from the content-addressed store, hash-verified

455}
456
457func TestState_Len(t *testing.T) {
458 t.Parallel()
459 st := newState()
460
461 require.Equal(t, 0, st.Len())
462
463 st.Set("a", "a")
464 require.Equal(t, 1, st.Len())
465
466 st.Set("b", "b")
467 require.Equal(t, 2, st.Len())
468
469 st.Delete("a")
470 require.Equal(t, 1, st.Len())
471}
472
473type testCase[T any] struct {
474 value any

Callers

nothing calls this directly

Calls 4

newStateFunction · 0.85
LenMethod · 0.65
SetMethod · 0.65
DeleteMethod · 0.65

Tested by

no test coverage detected