testify/assert
Daniel White f36bfe3c33
Fix Subset/NotSubset when map is missing keys from the subset (#1261)
`MapIndex` returns a zero `reflect.Value` if the map value does not
exist. This now aligns more closely with `InDeltaMapValues` by
checking `reflect/Value.IsValid`.

The use of `recover()` was hiding this error by setting the result of
the test to be "false" despite the test suite passing. This led to
flapping tests where they would succeed if the panic occurred on a
missing key before comparing key values that didn't match!

I've ensured the test suite now asserts on the expected error message
and added another example where the subset has keys not found on the
map under test.
2023-02-25 22:46:30 +10:00
..
assertion_compare.go Support comparing byte slice (#1202) 2022-06-21 14:54:58 +10:00
assertion_compare_can_convert.go assert: fix typo 2022-05-04 20:29:57 +10:00
assertion_compare_go1.17_test.go Support comparing byte slice (#1202) 2022-06-21 14:54:58 +10:00
assertion_compare_legacy.go Use cross Go version compatible build tag syntax 2022-02-15 20:26:04 +10:00
assertion_compare_test.go assert: guard CanConvert call in backward compatible wrapper 2022-02-15 20:26:04 +10:00
assertion_format.go Add WithinTimeRange method (#1188) 2022-06-28 21:14:39 +10:00
assertion_format.go.tmpl Fix vim-go integration and other editors 2018-02-02 18:39:40 +00:00
assertion_forward.go Add WithinTimeRange method (#1188) 2022-06-28 21:14:39 +10:00
assertion_forward.go.tmpl Fix vim-go integration and other editors 2018-02-02 18:39:40 +00:00
assertion_order.go fix msgAndArgs forwarding 2022-02-10 20:09:05 +10:00
assertion_order_test.go add tests for correct msgAndArgs forwarding 2022-02-10 20:09:05 +10:00
assertions.go Fix Subset/NotSubset when map is missing keys from the subset (#1261) 2023-02-25 22:46:30 +10:00
assertions_test.go Fix Subset/NotSubset when map is missing keys from the subset (#1261) 2023-02-25 22:46:30 +10:00
doc.go Merge pull request #196 from phemmer/remove-overview 2015-08-26 11:20:00 -07: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 This reverts commit 0a813b5898. 2020-06-05 20:47:15 +10:00
http_assertions_test.go fix linting errors in /assert package 2021-08-24 21:55:23 +10:00