Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/template_test.go')
-rw-r--r--tpl/template_test.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/tpl/template_test.go b/tpl/template_test.go
index 2dcf0b12d..8b5f46170 100644
--- 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
}