testify/assert
Arjun Mahishi 4c4d0118a6 assert: Fix EqualValues to handle overflow/underflow
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
2024-02-14 18:12:21 +05:30
..
internal/unsafetests assert: more unsafe.Pointer tests 2023-11-09 16:32:25 +01:00
assertion_compare.go Remove canConvert because Go 1.16 is dropped from support 2023-10-10 14:28:34 +02:00
assertion_compare_test.go Remove canConvert because Go 1.16 is dropped from support 2023-10-10 14:28:34 +02:00
assertion_format.go Add map support doc comments to Subset and NotSubset 2023-10-31 00:24:17 +01:00
assertion_format.go.tmpl
assertion_forward.go Add map support doc comments to Subset and NotSubset 2023-10-31 00:24:17 +01:00
assertion_forward.go.tmpl
assertion_order.go
assertion_order_test.go
assertions.go assert: Fix EqualValues to handle overflow/underflow 2024-02-14 18:12:21 +05:30
assertions_test.go assert: Fix EqualValues to handle overflow/underflow 2024-02-14 18:12:21 +05:30
doc.go
errors.go
forward_assertions.go
forward_assertions_test.go
http_assertions.go assert: fix httpCode and HTTPBody occur panic when http.Handler read body 2023-10-15 23:34:32 +02:00
http_assertions_test.go assert: fix httpCode and HTTPBody occur panic when http.Handler read body 2023-10-15 23:34:32 +02:00