Skip to content

Commit dc50d65

Browse files
committed
Set: Add unit test for New with entries
1 parent 6e483a4 commit dc50d65

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

set/dict_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,22 @@ func TestExists(t *testing.T) {
7676
}
7777
}
7878

79+
func TestExists_WithNewItems(t *testing.T) {
80+
set := New(`test`, `test1`)
81+
82+
if !set.Exists(`test`) {
83+
t.Errorf(`Correct existence not determined`)
84+
}
85+
86+
if !set.Exists(`test1`) {
87+
t.Errorf(`Correct existence not determined`)
88+
}
89+
90+
if set.Exists(`test2`) {
91+
t.Errorf(`Correct nonexistence not determined.`)
92+
}
93+
}
94+
7995
func TestLen(t *testing.T) {
8096
set := New()
8197
set.Add(`test`)

0 commit comments

Comments
 (0)