aboutsummaryrefslogtreecommitdiff
path: root/sets_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'sets_test.go')
-rw-r--r--sets_test.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/sets_test.go b/sets_test.go
index b3900fc..ca3aa3d 100644
--- a/sets_test.go
+++ b/sets_test.go
@@ -6,7 +6,8 @@ import (
func TestSetsPut(t *testing.T) {
s := NewSet[string](nil)
- s2 := s.Set("1").Set("1")
+ s2 := s.Add("1").Add("1")
+ s2.Add("2")
if s.Len() != 0 {
t.Fatalf("Unexpected mutation of set")
}
@@ -33,7 +34,7 @@ func TestSetsPut(t *testing.T) {
func TestSetsDelete(t *testing.T) {
s := NewSet[string](nil)
- s2 := s.Set("1")
+ s2 := s.Add("1")
s3 := s.Delete("1")
if s2.Len() != 1 {
t.Fatalf("Unexpected non-mutation of set")
@@ -51,7 +52,7 @@ func TestSetsDelete(t *testing.T) {
func TestSortedSetsPut(t *testing.T) {
s := NewSortedSet[string](nil)
- s2 := s.Set("1").Set("1").Set("0")
+ s2 := s.Add("1").Add("1").Add("0")
if s.Len() != 0 {
t.Fatalf("Unexpected mutation of set")
}
@@ -85,7 +86,7 @@ func TestSortedSetsPut(t *testing.T) {
func TestSortedSetsDelete(t *testing.T) {
s := NewSortedSet[string](nil)
- s2 := s.Set("1")
+ s2 := s.Add("1")
s3 := s.Delete("1")
if s2.Len() != 1 {
t.Fatalf("Unexpected non-mutation of set")