Skip to content
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

Testify assert.EqualValues should equate nested []interface{} by values #1057

Open
harryzcy opened this issue Mar 1, 2021 · 0 comments · May be fixed by #1058
Open

Testify assert.EqualValues should equate nested []interface{} by values #1057

harryzcy opened this issue Mar 1, 2021 · 0 comments · May be fixed by #1058

Comments

@harryzcy
Copy link

harryzcy commented Mar 1, 2021

For slices of type []interface{}, if elements have the same value but different type, assert.EqualValues would fail.

e.g.

// assertion would fail
assert.EqualValues(t, []interface{}{1}, []interface{}{int64(1)})

Now as a workaround I have to iterate over objects and compare element by element. It will be handy if assert.EqualValues compare two nested objects by element value.

@harryzcy harryzcy linked a pull request Mar 1, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant