Tags: stretchr/testify
Tags
EqualExportedValues: Handle nested pointer, slice and map fields (#1379) * EqualExportedValues: Handle pointer and slice fields * Update assert/assertions.go Co-authored-by: Michael Pu <michael.pu123@gmail.com> * Reduce redundant calls to 'copyExportedFields' * Update comments * Add support for maps * Update Go version support to 1.19 and onward * Re-generate after rebasing --------- Co-authored-by: Michael Pu <michael.pu123@gmail.com>
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.
Bump github.com/stretchr/objx from 0.4.0 to 0.5.0 (#1283) Bumps [github.com/stretchr/objx](https://github.com/stretchr/objx) from 0.4.0 to 0.5.0. - [Release notes](https://github.com/stretchr/objx/releases) - [Commits](stretchr/objx@v0.4.0...v0.5.0) --- updated-dependencies: - dependency-name: github.com/stretchr/objx dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
impr: `CallerInfo` should print full paths to the terminal (#1201) * impr: `CallerInfo` should print full paths to the terminal I am proposing this simple change, which changes this output ``` --- FAIL: TestABC (0.00s) --- FAIL: TestABC/C (0.00s) /this/is/a/path/to/file_test.go:258: Error Trace: file_test.go:258 file_test.go:748 Error: Not equal: ... ``` to this: ``` --- FAIL: TestABC (0.00s) --- FAIL: TestABC/C (0.00s) /this/is/a/path/to/file_test.go:258: Error Trace: /this/is/a/path/to/file_test.go:258 /this/is/a/path/to/file_test.go:748 Error: Not equal: ... ``` With the latter output, it is much more straightforward to find the file you are looking for, even though in the displayed case, the file is the same. However, for VSCodium, the case is a little more helpful, since VSCodium's terminal is smart enough to recognize the output, and make links out of that input. Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com> * test: fix the tests that depended on the previous behavior Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com> Co-authored-by: Stavros Ntentos <11300730-stavros-relex@users.noreply.gitlab.com>
fixing panic in calls to assertion with nil m.mutex (#1212) * fixing panic in calls to assertion with nil m.mutex This reverts a change that was made in #1182 The PR makes m.mutex a pointer which now needs to be checked but it's not checked for nil everywhere. This should also help with these issues: - #1208 - #1210 * Revert throwing out the lock because other concurrent calls can already have it locked * fix go vet copy lock by using pointer * fix obj assignment for passing test
Bump actions/setup-go from 3.1.0 to 3.2.0 (#1191) Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3.1.0 to 3.2.0. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](actions/setup-go@v3.1.0...v3.2.0) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
PreviousNext