Skip to content

Commit

Permalink
Added unit-test for failing case
Browse files Browse the repository at this point in the history
Signed-off-by: Springcomp <[email protected]>
  • Loading branch information
springcomp committed Jan 14, 2025
1 parent 5f24797 commit 22c8032
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/interpreter/interpreter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,13 @@ func TestCanSupportEvaluatingRightHandSideOfStringSlice(t *testing.T) {
assert.Nil(err)
assert.Equal(result.(float64), 3.0)
}
func TestErrEvaluatingRightHandSideOfStringSlice(t *testing.T) {
assert := assert.New(t)
data := make(map[string]interface{})
_, err := search(t, "'foo'[:].unknown(@)", data)
assert.NotNil(err)
assert.Equal("unknown function: unknown", err.Error())
}

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

0 comments on commit 22c8032

Please sign in to comment.