testify
testify copied to clipboard
Add TimeEqual function to better compare times
Summary
In order to fix JSON-unmarshalled comparison (https://github.com/stretchr/testify/issues/1160), we've added a new function TimeEqual() that compares timestamps instead of time.Time fields. This also allows you to compare times with different time zones.
Changes
- added
TimeEqualto compare by timestamps
Motivation
To fix https://github.com/stretchr/testify/issues/1160 and to allow comparison with different time zones.
Related issues
Closes https://github.com/stretchr/testify/issues/1160
assert.Equal() already supports time.Time values.