-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Description
The following test cases fail when added to tpl/template_funcs_test.go:TestIntersect:
{[]string{"a", "b", "c"}, []string{"a", "b", "b"}, []string{"a", "b"}},
{[]interface{}{"a", "b", "c"}, []interface{}{"a", "b", "b"}, []interface{}{"a", "b"}},Test results:
--- FAIL: TestIntersect (0.00s)
template_funcs_test.go:791: [0] got [a b b] but expected [a b]
template_funcs_test.go:791: [1] got [] but expected [a b]
Regarding test 0, in is used by intersect to avoid adding duplicates to the new set. In this case, in is receiving a reflect.Value struct, but the reflect.Struct case is not handled by in.
Regarding test 1, intersect does not handle the reflect.Interface case. See Questions about "intersect" function forum discussion.
Tests were done in Go 1.6 and Hugo HEAD.