Test Equals()
(t *testing.T)
| 68 | |
| 69 | // Test Equals() |
| 70 | func TestIntSetEquals(t *testing.T) { |
| 71 | s1 := Create(1, 2, 3) |
| 72 | s2 := Create(3, 2, 1) |
| 73 | s3 := Create(1, 2) |
| 74 | |
| 75 | if !s1.Equals(s2) { |
| 76 | t.Fatalf("expected s1 to equal s2") |
| 77 | } |
| 78 | if s1.Equals(s3) { |
| 79 | t.Fatalf("expected s1 not to equal s3") |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | // Test Intersection() |
| 84 | func TestIntSetIntersection(t *testing.T) { |