(t *testing.T)
| 5 | ) |
| 6 | |
| 7 | func TestNew(t *testing.T) { |
| 8 | set := New(1, 2, 3) |
| 9 | if set.Len() != 3 { |
| 10 | t.Errorf("expecting 3 elements in the set but got %v: %v", set.Len(), set.GetItems()) |
| 11 | } |
| 12 | for _, n := range []int{1, 2, 3} { |
| 13 | if !set.In(n) { |
| 14 | t.Errorf("expecting %d to be present in the set but was not; set is %v", n, set.GetItems()) |
| 15 | } |
| 16 | } |
| 17 | if set.In(5) { |
| 18 | t.Errorf("expecting 5 not to be present in the set but it was; set is %v", set.GetItems()) |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | func TestAdd(t *testing.T) { |
| 23 | td := []struct { |