Skip to content

Commit 4c93d8f

Browse files
EqualExportedValues: Handle nested pointer, slice and map fields (#1379)
* EqualExportedValues: Handle pointer and slice fields * Update assert/assertions.go Co-authored-by: Michael Pu <[email protected]> * 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 <[email protected]>
1 parent 4b2f4d2 commit 4c93d8f

18 files changed

+1214
-949
lines changed

.github/workflows/main.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ jobs:
66
runs-on: ubuntu-latest
77
strategy:
88
matrix:
9-
go_version: ["1.18.1", "1.17.6", "1.16.5"]
9+
go_version: ["1.20", "1.19"]
1010
steps:
1111
- uses: actions/checkout@v3
1212
- name: Setup Go
1313
uses: actions/[email protected]
1414
with:
1515
go-version: ${{ matrix.go_version }}
16-
- run: ./.ci.gogenerate.sh
16+
- run: ./.ci.gogenerate.sh
1717
- run: ./.ci.gofmt.sh
1818
- run: ./.ci.govet.sh
1919
- run: go test -v -race ./...

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ To update Testify to the latest version, use `go get -u github.com/stretchr/test
348348
Supported go versions
349349
==================
350350

351-
We currently support the most recent major Go versions from 1.13 onward.
351+
We currently support the most recent major Go versions from 1.19 onward.
352352

353353
------
354354

assert/assertion_compare.go

+18-18
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,9 @@ func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) {
352352

353353
// Greater asserts that the first element is greater than the second
354354
//
355-
// assert.Greater(t, 2, 1)
356-
// assert.Greater(t, float64(2), float64(1))
357-
// assert.Greater(t, "b", "a")
355+
// assert.Greater(t, 2, 1)
356+
// assert.Greater(t, float64(2), float64(1))
357+
// assert.Greater(t, "b", "a")
358358
func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
359359
if h, ok := t.(tHelper); ok {
360360
h.Helper()
@@ -364,10 +364,10 @@ func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface
364364

365365
// GreaterOrEqual asserts that the first element is greater than or equal to the second
366366
//
367-
// assert.GreaterOrEqual(t, 2, 1)
368-
// assert.GreaterOrEqual(t, 2, 2)
369-
// assert.GreaterOrEqual(t, "b", "a")
370-
// assert.GreaterOrEqual(t, "b", "b")
367+
// assert.GreaterOrEqual(t, 2, 1)
368+
// assert.GreaterOrEqual(t, 2, 2)
369+
// assert.GreaterOrEqual(t, "b", "a")
370+
// assert.GreaterOrEqual(t, "b", "b")
371371
func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
372372
if h, ok := t.(tHelper); ok {
373373
h.Helper()
@@ -377,9 +377,9 @@ func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...in
377377

378378
// Less asserts that the first element is less than the second
379379
//
380-
// assert.Less(t, 1, 2)
381-
// assert.Less(t, float64(1), float64(2))
382-
// assert.Less(t, "a", "b")
380+
// assert.Less(t, 1, 2)
381+
// assert.Less(t, float64(1), float64(2))
382+
// assert.Less(t, "a", "b")
383383
func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
384384
if h, ok := t.(tHelper); ok {
385385
h.Helper()
@@ -389,10 +389,10 @@ func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{})
389389

390390
// LessOrEqual asserts that the first element is less than or equal to the second
391391
//
392-
// assert.LessOrEqual(t, 1, 2)
393-
// assert.LessOrEqual(t, 2, 2)
394-
// assert.LessOrEqual(t, "a", "b")
395-
// assert.LessOrEqual(t, "b", "b")
392+
// assert.LessOrEqual(t, 1, 2)
393+
// assert.LessOrEqual(t, 2, 2)
394+
// assert.LessOrEqual(t, "a", "b")
395+
// assert.LessOrEqual(t, "b", "b")
396396
func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool {
397397
if h, ok := t.(tHelper); ok {
398398
h.Helper()
@@ -402,8 +402,8 @@ func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...inter
402402

403403
// Positive asserts that the specified element is positive
404404
//
405-
// assert.Positive(t, 1)
406-
// assert.Positive(t, 1.23)
405+
// assert.Positive(t, 1)
406+
// assert.Positive(t, 1.23)
407407
func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) bool {
408408
if h, ok := t.(tHelper); ok {
409409
h.Helper()
@@ -414,8 +414,8 @@ func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) bool {
414414

415415
// Negative asserts that the specified element is negative
416416
//
417-
// assert.Negative(t, -1)
418-
// assert.Negative(t, -1.23)
417+
// assert.Negative(t, -1)
418+
// assert.Negative(t, -1.23)
419419
func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) bool {
420420
if h, ok := t.(tHelper); ok {
421421
h.Helper()

assert/assertion_format.go

+102-102
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)