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

Function TestSliceValues

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

Source from the content-addressed store, hash-verified

339 assert.Equal(t, 1, len(m))
340}
341func TestSliceValues(t *testing.T) {
342 v := NewSliceValuesNative([]interface{}{"a"})
343 assert.Equal(t, 1, v.Len())
344 assert.Equal(t, "a", v.Val()[0].ToString())
345 v.Append(NewStringValue("b"))
346 assert.Equal(t, 2, v.Len())
347 assert.Equal(t, "b", v.Val()[1].ToString())
348 assert.Equal(t, 2, len(v.Values()))
349}
350func TestMapValue(t *testing.T) {
351 mv := map[string]interface{}{"k1": 10}
352 v := NewMapValue(mv)

Callers

nothing calls this directly

Calls 8

NewSliceValuesNativeFunction · 0.85
NewStringValueFunction · 0.85
EqualMethod · 0.65
LenMethod · 0.65
ToStringMethod · 0.65
ValuesMethod · 0.65
ValMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected