hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 1b91fec0ac28eac8dde6a7431bab7b11f286bdce
parent ee34a840bc286d6668f3404ded3809e5e31569ad
Author: bep <bjorn.erik.pedersen@gmail.com>
Date:   Tue, 20 Jan 2015 17:15:12 +0100

Add tests for IsSet

Diffstat:
Mtpl/template_test.go | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)
diff --git a/tpl/template_test.go b/tpl/template_test.go
@@ -361,6 +361,16 @@ func TestIntersect(t *testing.T) {
 	}
 }
 
+func TestIsSet(t *testing.T) {
+	aSlice := []interface{}{1, 2, 3, 5}
+	aMap := map[string]interface{}{"a": 1, "b": 2}
+
+	assert.True(t, IsSet(aSlice, 2))
+	assert.True(t, IsSet(aMap, "b"))
+	assert.False(t, IsSet(aSlice, 22))
+	assert.False(t, IsSet(aMap, "bc"))
+}
+
 func (x *TstX) TstRp() string {
 	return "r" + x.A
 }