tests: add testing around set and es aggregate

This commit is contained in:
Jon Lundy
2022-09-06 15:31:48 -06:00
parent 700d6370f2
commit a42270c6ac
7 changed files with 188 additions and 72 deletions

25
pkg/set/set_test.go Normal file
View File

@@ -0,0 +1,25 @@
package set_test
import (
"strings"
"testing"
"github.com/matryer/is"
"github.com/sour-is/ev/pkg/set"
)
func TestStringSet(t *testing.T) {
is := is.New(t)
s := set.New(strings.Fields("one two three")...)
is.True(s.Has("one"))
is.True(s.Has("two"))
is.True(s.Has("three"))
is.True(!s.Has("four"))
is.Equal(set.New("one").String(), "set(one)")
var n set.Set[string]
is.Equal(n.String(), "set(<nil>)")
}