| 1 | package utils |
| 2 | |
| 3 | import "testing" |
| 4 | |
| 5 | func TestIntersect(t *testing.T) { |
| 6 | intersection, aNotB, bNotA := Intersect([]string{"a", "b"}, []string{"b", "c"}) |
| 7 | if len(intersection) != 1 || intersection[0] != "b" { |
| 8 | t.Fatalf("intersection %v", intersection) |
| 9 | } |
| 10 | if len(aNotB) != 1 || aNotB[0] != "a" { |
| 11 | t.Fatalf("aNotB %v", aNotB) |
| 12 | } |
| 13 | if len(bNotA) != 1 || bNotA[0] != "c" { |
| 14 | t.Fatalf("bNotA %v", bNotA) |
| 15 | } |
| 16 | } |