From 972befb3de97904430959f0925b8abd4b2c696b3 Mon Sep 17 00:00:00 2001 From: Craig Davison Date: Tue, 31 Oct 2023 11:59:06 -0600 Subject: [PATCH] Review comments --- assert/assertions_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/assert/assertions_test.go b/assert/assertions_test.go index ff424b7db..2324e7111 100644 --- a/assert/assertions_test.go +++ b/assert/assertions_test.go @@ -3143,21 +3143,24 @@ func TestErrorAs(t *testing.T) { { err: io.EOF, result: false, - resultErrMsg: "Should be in error chain:\n" + + resultErrMsg: "" + + "Should be in error chain:\n" + "expected: **assert.customError\n" + "in chain: \"EOF\" (*errors.errorString)\n", }, { err: nil, result: false, - resultErrMsg: "Should be in error chain:\n" + + resultErrMsg: "" + + "Should be in error chain:\n" + "expected: **assert.customError\n" + "in chain: \n", }, { err: fmt.Errorf("abc: %w", errors.New("def")), result: false, - resultErrMsg: "Should be in error chain:\n" + + resultErrMsg: "" + + "Should be in error chain:\n" + "expected: **assert.customError\n" + "in chain: \"abc: def\" (*fmt.wrapError)\n" + "\t\"def\" (*errors.errorString)\n", @@ -3165,9 +3168,9 @@ func TestErrorAs(t *testing.T) { } for _, tt := range tests { tt := tt - mockT := new(captureTestingT) var target *customError t.Run(fmt.Sprintf("ErrorAs(%#v,%#v)", tt.err, target), func(t *testing.T) { + mockT := new(captureTestingT) res := ErrorAs(mockT, tt.err, &target) mockT.checkResultAndErrMsg(t, tt.result, res, tt.resultErrMsg) })