Test Add() and Contains()
(t *testing.T)
| 44 | |
| 45 | // Test Add() and Contains() |
| 46 | func TestIntSetAdd(t *testing.T) { |
| 47 | s := New[int]() |
| 48 | s.Add(42) |
| 49 | if !s.Contains(42) { |
| 50 | t.Fatalf("expected set to contain 42") |
| 51 | } |
| 52 | if s.Contains(99) { |
| 53 | t.Fatalf("expected set not to contain 99") |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | // Test Remove() |
| 58 | func TestIntSetRemove(t *testing.T) { |