stretchr / testify

A toolkit with common assertions and mocks that plays nicely with the standard library
MIT License
22.51k stars 1.56k forks source link

assert: add position and pass msg to underlying func in InDeltaMapValues, InDeltaMapValues, and InEpsilonSlice #1514

Open hendrywiranto opened 7 months ago

hendrywiranto commented 7 months ago

Summary

Add position and pass msg to underlying func in InDeltaSlice, InDeltaMapValues, and InEpsilonSlice

Changes

Motivation

When using those 3 functions, users don't know which key/index of the map/slice that produces the error because currently it's not added into the msgAndArgs slice.

Example

InDeltaSlice

Before
image

After
image

InDeltaMapValues

Before
image

After
image

InEpsilonSlice

Before
image

After
image