| 48 | } |
| 49 | |
| 50 | func TestStringSetDeleteMultiples(t *testing.T) { |
| 51 | s := StringSet{} |
| 52 | s.Insert("a", "b", "c") |
| 53 | if len(s) != 3 { |
| 54 | t.Errorf("Expected len=3: %d", len(s)) |
| 55 | } |
| 56 | |
| 57 | s.Delete("a", "c") |
| 58 | if len(s) != 1 { |
| 59 | t.Errorf("Expected len=1: %d", len(s)) |
| 60 | } |
| 61 | if s.Has("a") { |
| 62 | t.Errorf("Unexpected contents: %#v", s) |
| 63 | } |
| 64 | if s.Has("c") { |
| 65 | t.Errorf("Unexpected contents: %#v", s) |
| 66 | } |
| 67 | if !s.Has("b") { |
| 68 | t.Errorf("Missing contents: %#v", s) |
| 69 | } |
| 70 | |
| 71 | } |
| 72 | |
| 73 | func TestNewStringSet(t *testing.T) { |
| 74 | s := NewStringSet("a", "b", "c") |