testify/assert
wwade 437071b948
assert: fix error message formatting for NotContains (#1362)
* assert: rename and refactor TestContainsFailMessage

I've renamed it to TestContainsNotContains and added a test case
structure so that I can use this test to validate the failure messages
from both Contains and NotContains,

There are no functional changes here, strictly refactoring. A new test
case will be added in a subsequent change.

* assert: fix error message formatting for NotContains

It was using "%s" to format the s and contains arguments, but these
could be any type that supports iteration such as a map. In this case
of NotContains failing against a map, it would print something like:

   "map[one:%!s(int=1)]" should not contain "one"

Fix this using "%#v" as was already done for Contains and added test
cases covering both the "len()" / iterable failure messages as well as
the Contains/NotContains failure case.

The new message for this example map would be something like:

    map[string]int{"one":1} should not contain "one"
2023-05-05 14:05:51 +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 Compare public elements of struct (#1309) 2023-03-14 22:01:35 +10:00
assertion_format.go.tmpl
assertion_forward.go Compare public elements of struct (#1309) 2023-03-14 22:01:35 +10:00
assertion_forward.go.tmpl
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 assert: fix error message formatting for NotContains (#1362) 2023-05-05 14:05:51 +10:00
assertions_test.go assert: fix error message formatting for NotContains (#1362) 2023-05-05 14:05:51 +10:00
doc.go
errors.go
forward_assertions.go
forward_assertions_test.go Add ErrorContains 2021-01-16 12:32:05 +11:00
http_assertions.go
http_assertions_test.go fix linting errors in /assert package 2021-08-24 21:55:23 +10:00