File: utils_test.go

package info (click to toggle)
golang-github-wildducktheories-go-csv 0.0~git20170625.a843eda-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 188 kB
  • sloc: makefile: 5
file content (16 lines) | stat: -rw-r--r-- 401 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package utils

import "testing"

func TestIntersect(t *testing.T) {
	intersection, aNotB, bNotA := Intersect([]string{"a", "b"}, []string{"b", "c"})
	if len(intersection) != 1 || intersection[0] != "b" {
		t.Fatalf("intersection %v", intersection)
	}
	if len(aNotB) != 1 || aNotB[0] != "a" {
		t.Fatalf("aNotB %v", aNotB)
	}
	if len(bNotA) != 1 || bNotA[0] != "c" {
		t.Fatalf("bNotA %v", bNotA)
	}
}