From 3d99b41252afd108c14583383f0fd6b02b21537c Mon Sep 17 00:00:00 2001 From: James Littlejohn Date: Fri, 21 Jul 2017 10:57:52 +1000 Subject: [PATCH] Add test --- expressions/expressions_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/expressions/expressions_test.go b/expressions/expressions_test.go index 033ee49..f381c52 100644 --- a/expressions/expressions_test.go +++ b/expressions/expressions_test.go @@ -1,6 +1,7 @@ package expressions import ( + "errors" "fmt" "strings" "testing" @@ -134,6 +135,10 @@ func TestEvaluateString(t *testing.T) { _, err = EvaluateString("1 | undefined_filter", ctx) require.Error(t, err) + + cfg.AddFilter("error", func(input interface{}) (string, error) { return "", errors.New("test error") }) + _, err = EvaluateString("1 | error", ctx) + require.Error(t, err) } func TestClosure(t *testing.T) {