mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-10 15:52:27 +08:00
feat: add ReverseIntersect function
This commit is contained in:
@@ -407,7 +407,18 @@ func TestIntersection(t *testing.T) {
|
||||
for i := 0; i < len(res); i++ {
|
||||
assert.Equal(expected[i], res[i])
|
||||
}
|
||||
// assert.IsNil(Intersection())
|
||||
}
|
||||
|
||||
func TestReverseIntersect(t *testing.T) {
|
||||
assert := internal.NewAssert(t, "TestIntersection")
|
||||
|
||||
s1 := []int{1, 2, 3}
|
||||
s2 := []int{1, 2, 4}
|
||||
s3 := []int{1, 2, 3, 5}
|
||||
|
||||
assert.Equal([]int{1, 2, 3}, ReverseIntersect(s1))
|
||||
assert.Equal([]int{3, 4}, ReverseIntersect(s1, s2))
|
||||
assert.Equal([]int{3, 4, 5}, ReverseIntersect(s1, s2, s3))
|
||||
}
|
||||
|
||||
func TestReverse(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user