From a120f215b079c29601d14051b1dbb25f2ab1fd38 Mon Sep 17 00:00:00 2001 From: Craig Davison Date: Mon, 31 Jul 2023 16:41:32 -0600 Subject: [PATCH] address some review comments --- assert/assertions_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assert/assertions_test.go b/assert/assertions_test.go index 2d3302208..3e0771c64 100644 --- a/assert/assertions_test.go +++ b/assert/assertions_test.go @@ -2857,6 +2857,8 @@ func Test_truncatingFormat(t *testing.T) { } } +// parseLabeledOutput does the inverse of labeledOutput - it takes a formatted +// output string and turns it back into a slice of labeledContent. func parseLabeledOutput(output string) []labeledContent { labelPattern := regexp.MustCompile(`^\t([^\t]*): *\t(.*)$`) contentPattern := regexp.MustCompile(`^\t *\t(.*)$`) @@ -2986,8 +2988,8 @@ func TestErrorIs(t *testing.T) { } for _, tt := range tests { tt := tt - mockT := new(captureTestingT) t.Run(fmt.Sprintf("ErrorIs(%#v,%#v)", tt.err, tt.target), func(t *testing.T) { + mockT := new(captureTestingT) res := ErrorIs(mockT, tt.err, tt.target) mockT.checkResultAndErrMsg(t, tt.result, res, tt.resultErrMsg) }) @@ -3049,8 +3051,8 @@ func TestNotErrorIs(t *testing.T) { } for _, tt := range tests { tt := tt - mockT := new(captureTestingT) t.Run(fmt.Sprintf("NotErrorIs(%#v,%#v)", tt.err, tt.target), func(t *testing.T) { + mockT := new(captureTestingT) res := NotErrorIs(mockT, tt.err, tt.target) mockT.checkResultAndErrMsg(t, tt.result, res, tt.resultErrMsg) })