MCPcopy
hub / github.com/grafana/dskit / TestNewLimitsMap

Function TestNewLimitsMap

flagext/map_test.go:33–51  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

31}
32
33func TestNewLimitsMap(t *testing.T) {
34 t.Run("float64", func(t *testing.T) {
35 lm := NewLimitsMap(fakeFloat64Validator)
36 lm.data["key1"] = 10.6
37 require.Len(t, lm.Read(), 1)
38 })
39
40 t.Run("int", func(t *testing.T) {
41 lm := NewLimitsMap(fakeIntValidator)
42 lm.data["key1"] = 10
43 require.Len(t, lm.Read(), 1)
44 })
45
46 t.Run("string", func(t *testing.T) {
47 lm := NewLimitsMap(fakeStringValidator)
48 lm.data["key1"] = "test"
49 require.Len(t, lm.Read(), 1)
50 })
51}
52
53func TestLimitsMap_IsNil(t *testing.T) {
54 tc := map[string]struct {

Callers

nothing calls this directly

Calls 4

NewLimitsMapFunction · 0.85
RunMethod · 0.80
ReadMethod · 0.65
LenMethod · 0.45

Tested by

no test coverage detected