1
0
mirror of https://github.com/danog/liquid.git synced 2024-12-02 23:47:50 +01:00
liquid/expression/functional_test.go

23 lines
466 B
Go
Raw Normal View History

package expression
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestConstant(t *testing.T) {
ctx := NewContext(map[string]interface{}{}, NewConfig())
k := Constant(10)
v, err := k.Evaluate(ctx)
require.NoError(t, err)
require.Equal(t, 10, v)
}
func TestNot(t *testing.T) {
ctx := NewContext(map[string]interface{}{}, NewConfig())
k := Constant(10)
v, err := Not(k).Evaluate(ctx)
require.NoError(t, err)
require.Equal(t, false, v)
}