tpl/collections: Return error on invalid input in in

See #5875
This commit is contained in:
Bjørn Erik Pedersen
2019-04-19 08:58:12 +02:00
parent 06f56fc983
commit 7fbfedf013
3 changed files with 16 additions and 12 deletions

View File

@@ -313,9 +313,14 @@ func TestIn(t *testing.T) {
errMsg := fmt.Sprintf("[%d] %v", i, test)
result := ns.In(test.l1, test.l2)
result, err := ns.In(test.l1, test.l2)
assert.NoError(err)
assert.Equal(test.expect, result, errMsg)
}
// Slices are not comparable
_, err := ns.In([]string{"a", "b"}, []string{"a", "b"})
assert.Error(err)
}
type testPage struct {