MCPcopy Create free account
hub / github.com/jmespath/go-jmespath / TestCanSupportStructWithSlicingExpression

Function TestCanSupportStructWithSlicingExpression

interpreter_test.go:78–84  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

76}
77
78func TestCanSupportStructWithSlicingExpression(t *testing.T) {
79 assert := assert.New(t)
80 data := sliceType{A: "foo", B: []scalars{{"f1", "b1"}, {"correct", "b2"}}}
81 result, err := Search("B[:].Foo", data)
82 assert.Nil(err)
83 assert.Equal([]interface{}{"f1", "correct"}, result)
84}
85
86func TestCanSupportStructWithFilterProjection(t *testing.T) {
87 assert := assert.New(t)

Callers

nothing calls this directly

Calls 4

NewFunction · 0.92
NilFunction · 0.92
EqualFunction · 0.92
SearchFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…