vendor: update all dependencies to latest versions
This commit is contained in:
parent
911d121bb9
commit
b017fcfe9a
3048 changed files with 537057 additions and 189681 deletions
20
vendor/github.com/jmespath/go-jmespath/interpreter_test.go
generated
vendored
20
vendor/github.com/jmespath/go-jmespath/interpreter_test.go
generated
vendored
|
@ -69,7 +69,7 @@ func TestCanSupportUserDefinedStructsRef(t *testing.T) {
|
|||
|
||||
func TestCanSupportStructWithSliceAll(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}}
|
||||
data := sliceType{A: "foo", B: []scalars{{"f1", "b1"}, {"correct", "b2"}}}
|
||||
result, err := Search("B[].Foo", data)
|
||||
assert.Nil(err)
|
||||
assert.Equal([]interface{}{"f1", "correct"}, result)
|
||||
|
@ -77,7 +77,7 @@ func TestCanSupportStructWithSliceAll(t *testing.T) {
|
|||
|
||||
func TestCanSupportStructWithSlicingExpression(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}}
|
||||
data := sliceType{A: "foo", B: []scalars{{"f1", "b1"}, {"correct", "b2"}}}
|
||||
result, err := Search("B[:].Foo", data)
|
||||
assert.Nil(err)
|
||||
assert.Equal([]interface{}{"f1", "correct"}, result)
|
||||
|
@ -85,7 +85,7 @@ func TestCanSupportStructWithSlicingExpression(t *testing.T) {
|
|||
|
||||
func TestCanSupportStructWithFilterProjection(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}}
|
||||
data := sliceType{A: "foo", B: []scalars{{"f1", "b1"}, {"correct", "b2"}}}
|
||||
result, err := Search("B[? `true` ].Foo", data)
|
||||
assert.Nil(err)
|
||||
assert.Equal([]interface{}{"f1", "correct"}, result)
|
||||
|
@ -93,7 +93,7 @@ func TestCanSupportStructWithFilterProjection(t *testing.T) {
|
|||
|
||||
func TestCanSupportStructWithSlice(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}}
|
||||
data := sliceType{A: "foo", B: []scalars{{"f1", "b1"}, {"correct", "b2"}}}
|
||||
result, err := Search("B[-1].Foo", data)
|
||||
assert.Nil(err)
|
||||
assert.Equal("correct", result)
|
||||
|
@ -109,7 +109,7 @@ func TestCanSupportStructWithOrExpressions(t *testing.T) {
|
|||
|
||||
func TestCanSupportStructWithSlicePointer(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
data := sliceType{A: "foo", C: []*scalars{&scalars{"f1", "b1"}, &scalars{"correct", "b2"}}}
|
||||
data := sliceType{A: "foo", C: []*scalars{{"f1", "b1"}, {"correct", "b2"}}}
|
||||
result, err := Search("C[-1].Foo", data)
|
||||
assert.Nil(err)
|
||||
assert.Equal("correct", result)
|
||||
|
@ -128,7 +128,7 @@ func TestWillAutomaticallyCapitalizeFieldNames(t *testing.T) {
|
|||
|
||||
func TestCanSupportStructWithSliceLowerCased(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}}
|
||||
data := sliceType{A: "foo", B: []scalars{{"f1", "b1"}, {"correct", "b2"}}}
|
||||
result, err := Search("b[-1].foo", data)
|
||||
assert.Nil(err)
|
||||
assert.Equal("correct", result)
|
||||
|
@ -173,6 +173,14 @@ func TestCanSupportProjectionsWithStructs(t *testing.T) {
|
|||
assert.Equal([]interface{}{"first", "second", "third"}, result)
|
||||
}
|
||||
|
||||
func TestCanSupportSliceOfStructsWithFunctions(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
data := []scalars{scalars{"a1", "b1"}, scalars{"a2", "b2"}}
|
||||
result, err := Search("length(@)", data)
|
||||
assert.Nil(err)
|
||||
assert.Equal(result.(float64), 2.0)
|
||||
}
|
||||
|
||||
func BenchmarkInterpretSingleFieldStruct(b *testing.B) {
|
||||
intr := newInterpreter()
|
||||
parser := NewParser()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue