assert icon indicating copy to clipboard operation
assert copied to clipboard

fail to equal time.Time

Open nicolasparada opened this issue 3 years ago • 1 comments

Given two times that are equal using their .Equal() method, they fail using assert.Equal().

Proposed solution

Instead of using reflect.DeepEqual(), first check if we are asserting times, and then use their .Equal() method.

nicolasparada avatar Nov 28 '22 18:11 nicolasparada

Same here, I have lots of workarounds because of datetimes. Because when it get serialized the timezone can change, although the absolute value is still the same (.Equal() returns true, but assert.Equal returns false)

racerxdl avatar Mar 17 '25 21:03 racerxdl