mirror of https://github.com/stretchr/testify.git
The underlying function ObjectsAreEqualValues did not handle overflow/underflow of values while converting one type to another for comparison. For example: EqualValues(t, int(270), int8(14)) would return true, even though the values are not equal. Because, when you convert int(270) to int8, it overflows and becomes 14 (270 % 256 = 14) This commit fixes that by making sure that the conversion always happens from the smaller type to the larger type, and then comparing the values. Additionally, this commit also seperates out the test cases of ObjectsAreEqualValues from TestObjectsAreEqual. Fixes #1462 |
||
---|---|---|
.. | ||
internal/unsafetests | ||
assertion_compare.go | ||
assertion_compare_test.go | ||
assertion_format.go | ||
assertion_format.go.tmpl | ||
assertion_forward.go | ||
assertion_forward.go.tmpl | ||
assertion_order.go | ||
assertion_order_test.go | ||
assertions.go | ||
assertions_test.go | ||
doc.go | ||
errors.go | ||
forward_assertions.go | ||
forward_assertions_test.go | ||
http_assertions.go | ||
http_assertions_test.go |