mirror of
https://github.com/danog/liquid.git
synced 2024-11-27 00:24:41 +01:00
23 lines
467 B
Go
23 lines
467 B
Go
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)
|
|
}
|