mirror of
https://github.com/danog/liquid.git
synced 2024-12-02 13:07:44 +01:00
Add test
This commit is contained in:
parent
8ee8cef491
commit
3d99b41252
@ -1,6 +1,7 @@
|
|||||||
package expressions
|
package expressions
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
@ -134,6 +135,10 @@ func TestEvaluateString(t *testing.T) {
|
|||||||
|
|
||||||
_, err = EvaluateString("1 | undefined_filter", ctx)
|
_, err = EvaluateString("1 | undefined_filter", ctx)
|
||||||
require.Error(t, err)
|
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) {
|
func TestClosure(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user