MCPcopy Create free account
hub / github.com/araddon/qlbridge / TestMapBoolValue

Function TestMapBoolValue

value/value_test.go:457–472  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

455 assert.Equal(t, n, mv.Val()["k1"].Value())
456}
457func TestMapBoolValue(t *testing.T) {
458
459 mbv := map[string]bool{"k1": true}
460 v := NewMapBoolValue(mbv)
461 _, ok := v.Get("k1")
462 assert.True(t, ok)
463 _, ok = v.Get("nope")
464 assert.Equal(t, false, ok)
465 assert.Equal(t, 1, v.MapValue().Len())
466 lv := v.SliceValue()
467 assert.Equal(t, 1, len(lv))
468
469 mv := v.MapValue()
470 assert.Equal(t, 1, mv.Len())
471 assert.Equal(t, true, mv.Val()["k1"].Value())
472}

Callers

nothing calls this directly

Calls 8

GetMethod · 0.95
MapValueMethod · 0.95
SliceValueMethod · 0.95
NewMapBoolValueFunction · 0.85
EqualMethod · 0.65
LenMethod · 0.65
ValueMethod · 0.65
ValMethod · 0.45

Tested by

no test coverage detected