mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Add tests for IsSet
This commit is contained in:
parent
ee34a840bc
commit
1b91fec0ac
1 changed files with 10 additions and 0 deletions
|
@ -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 {
|
func (x *TstX) TstRp() string {
|
||||||
return "r" + x.A
|
return "r" + x.A
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue