Test Union()
(t *testing.T)
| 106 | |
| 107 | // Test Union() |
| 108 | func TestIntSetUnion(t *testing.T) { |
| 109 | s1 := Create(1, 2, 3) |
| 110 | s2 := Create(3, 4, 5) |
| 111 | result := s1.Union(s2) |
| 112 | |
| 113 | expected := Create(1, 2, 3, 4, 5) |
| 114 | if !result.Equals(expected) { |
| 115 | t.Fatalf("expected union {1, 2, 3, 4, 5}, got: %v", result) |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | // Test Copy() |
| 120 | func TestIntSetCopy(t *testing.T) { |