1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
package bexpr
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestCreateEvaluator(t *testing.T) {
t.Parallel()
type testCase struct {
expression string
config EvaluatorConfig
err string
}
tests := map[string]testCase{
"basic": {
expression: "foo == 3",
},
}
for name, tcase := range tests {
name := name
tcase := tcase
t.Run(name, func(t *testing.T) {
t.Parallel()
expr, err := CreateEvaluator(tcase.expression, &tcase.config)
if tcase.err == "" {
require.NoError(t, err)
require.NotNil(t, expr)
}
})
}
}
|