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

Function TestCanSupportStructWithSlice

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

Source from the content-addressed store, hash-verified

92}
93
94func TestCanSupportStructWithSlice(t *testing.T) {
95 assert := assert.New(t)
96 data := sliceType{A: "foo", B: []scalars{{"f1", "b1"}, {"correct", "b2"}}}
97 result, err := Search("B[-1].Foo", data)
98 assert.Nil(err)
99 assert.Equal("correct", result)
100}
101
102func TestCanSupportStructWithOrExpressions(t *testing.T) {
103 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…