mirror of
https://github.com/danog/liquid.git
synced 2024-11-30 04:59:04 +01:00
Add test
This commit is contained in:
parent
8ee8cef491
commit
3d99b41252
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user