mirror of https://github.com/stretchr/testify.git
* 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" |
||
---|---|---|
.. | ||
assertion_compare.go | ||
assertion_compare_can_convert.go | ||
assertion_compare_go1.17_test.go | ||
assertion_compare_legacy.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 |