Add basic tests for DiffSect function

This commit is contained in:
2018-07-07 20:56:53 +01:00
parent a883e08a3f
commit 484eca552b
23 changed files with 6064 additions and 4 deletions

View File

@@ -1,8 +1,8 @@
package main
// diffsect removes all items in `a` from `b`, then removes all items from `b`
// DiffSect removes all items in `a` from `b`, then removes all items from `b`
// which are not in `c`. Effectively: intersect(difference(b, a), c)
func diffsect(a, b, c *[]string) *[]string {
func DiffSect(a, b, c *[]string) *[]string {
result := []string{}
mapA := map[string]bool{}
mapC := map[string]bool{}