New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkCondition should handle []interface{} for intersect operations #3718

Closed
moorereason opened this Issue Jul 19, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@moorereason
Contributor

moorereason commented Jul 19, 2017

The following new test cases fail in TestCheckCondition:

{reflect.ValueOf([]interface{}{"a"}), reflect.ValueOf([]string{"a", "b"}), "intersect", expect{true, false}},
{reflect.ValueOf([]string{"a"}), reflect.ValueOf([]interface{}{"a", "b"}), "intersect", expect{true, false}},

The issue is that checkCondition only sets slv and slmv (L106) if v and mv are of the same type (L85); therefore, the eventual call to ns.Intersect (L205) is made with two nil params.

See discussion thread for use case and rationale: https://discourse.gohugo.io/t/7435

Test site from @budparr: https://github.com/budparr/Test-Case-for-defining-relationships-across-sections/blob/master/layouts/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment