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 Fix vim-go integration and other editors 2018-02-02 18:39:40 +00:00
assertion_forward.go Add map support doc comments to Subset and NotSubset 2023-10-31 00:24:17 +01:00
assertion_forward.go.tmpl Fix vim-go integration and other editors 2018-02-02 18:39:40 +00:00
assertion_order.go EqualExportedValues: Handle nested pointer, slice and map fields (#1379) 2023-05-11 07:42:04 +10:00
assertion_order_test.go add tests for correct msgAndArgs forwarding 2022-02-10 20:09:05 +10:00
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 EqualExportedValues: Handle nested pointer, slice and map fields (#1379) 2023-05-11 07:42:04 +10:00
errors.go Clean up golint warnings 2014-06-18 09:28:16 -06:00
forward_assertions.go Make _codegen its own module so that its dependencies do not pollute the root modules dependency graph 2019-12-09 10:12:49 -07:00
forward_assertions_test.go Add ErrorContains 2021-01-16 12:32:05 +11:00
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