Skip to content

Commit

Permalink
Added unit-test
Browse files Browse the repository at this point in the history
Signed-off-by: Springcomp <[email protected]>
  • Loading branch information
springcomp committed Oct 27, 2024
1 parent 8dcafac commit a2e7b18
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/interpreter/interpreter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ func TestCanSupportSliceOfStructsWithFunctions(t *testing.T) {
assert.Equal(result.(float64), 2.0)
}

func TestCanSupportEvaluatingRightHandSideOfStringSlice(t *testing.T) {
assert := assert.New(t)
data := make(map[string]interface{})
result, err := search(t, "'foo'[:].length(@)", data)
assert.Nil(err)
assert.Equal(result.(float64), 3.0)
}

func BenchmarkInterpretSingleFieldStruct(b *testing.B) {
assert := assert.New(b)
intr := NewInterpreter(nil, nil)
Expand Down

0 comments on commit a2e7b18

Please sign in to comment.