diff options
Diffstat (limited to 'tpl/template_test.go')
-rw-r--r-- | tpl/template_test.go | 10 |
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 } |