1
0
mirror of https://github.com/danog/liquid.git synced 2024-11-30 05:58:59 +01:00
This commit is contained in:
Oliver Steele 2017-07-07 07:38:53 -04:00
parent 846987d86a
commit d435cf5211

View File

@ -0,0 +1,26 @@
package evaluator
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestIsEmpty(t *testing.T) {
require.True(t, IsEmpty(false))
require.False(t, IsEmpty(true))
require.True(t, IsEmpty([]string{}))
require.True(t, IsEmpty(map[string]interface{}{}))
require.False(t, IsEmpty([]string{""}))
require.False(t, IsEmpty(map[string]interface{}{"k": "v"}))
}
func TestIsTrue(t *testing.T) {
require.False(t, IsTrue(nil))
require.False(t, IsTrue(false))
require.True(t, IsTrue(true))
require.True(t, IsTrue(0))
require.True(t, IsTrue(""))
require.True(t, IsTrue([]string{}))
require.True(t, IsTrue(map[string]interface{}{}))
}