| 26 | ) |
| 27 | |
| 28 | func TestStringSet(t *testing.T) { |
| 29 | s := StringSet{} |
| 30 | if s.Len() != 0 { |
| 31 | t.Errorf("Expected len=0: %d", len(s)) |
| 32 | } |
| 33 | s.Insert("a", "b") |
| 34 | if s.Len() != 2 { |
| 35 | t.Errorf("Expected len=2: %d", len(s)) |
| 36 | } |
| 37 | s.Insert("c") |
| 38 | if s.Has("d") { |
| 39 | t.Errorf("Unexpected contents: %#v", s) |
| 40 | } |
| 41 | if !s.Has("a") { |
| 42 | t.Errorf("Missing contents: %#v", s) |
| 43 | } |
| 44 | s.Delete("a") |
| 45 | if s.Has("a") { |
| 46 | t.Errorf("Unexpected contents: %#v", s) |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | func TestStringSetDeleteMultiples(t *testing.T) { |
| 51 | s := StringSet{} |