Skip to content

assert.InEpsilonSlice doesn't append custom error message #1324

Description

@bushkov

Bug summary

When InEpsilonSlice takes a custom error message and the assertion fails, the custom message isn't displayed.

The issue is that in InEpsilonSlice implementation, msgAndArgs isn't passed to InEpsilon when iterating over slice elements:

result := InEpsilon(t, actualSlice.Index(i).Interface(), expectedSlice.Index(i).Interface(), epsilon)

It should be:

result := InEpsilon(t, actualSlice.Index(i).Interface(), expectedSlice.Index(i).Interface(), epsilon, msgAndArgs...)

To reproduce

Write any test where InEpsilonSlice fails and takes a custom message. The message wouldn't be displayed.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions