1
0
mirror of https://github.com/danog/liquid.git synced 2024-11-27 02:24:39 +01:00
liquid/expressions/functional_test.go

23 lines
467 B
Go
Raw Normal View History

2017-07-14 02:18:23 +02:00
package expressions
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)
}