Skip to content

Commit 331c520

Browse files
craig65535dolmen
authored andcommitted
Improve readability
1 parent 5f48c62 commit 331c520

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

assert/assertions_test.go

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3002,23 +3002,26 @@ func TestErrorIs(t *testing.T) {
30023002
err: io.EOF,
30033003
target: io.ErrClosedPipe,
30043004
result: false,
3005-
resultErrMsg: "Target error should be in err chain:\n" +
3005+
resultErrMsg: "" +
3006+
"Target error should be in err chain:\n" +
30063007
"expected: \"io: read/write on closed pipe\"\n" +
30073008
"in chain: \"EOF\"\n",
30083009
},
30093010
{
30103011
err: nil,
30113012
target: io.EOF,
30123013
result: false,
3013-
resultErrMsg: "Target error should be in err chain:\n" +
3014+
resultErrMsg: "" +
3015+
"Target error should be in err chain:\n" +
30143016
"expected: \"EOF\"\n" +
30153017
"in chain: \n",
30163018
},
30173019
{
30183020
err: io.EOF,
30193021
target: nil,
30203022
result: false,
3021-
resultErrMsg: "Target error should be in err chain:\n" +
3023+
resultErrMsg: "" +
3024+
"Target error should be in err chain:\n" +
30223025
"expected: \"\"\n" +
30233026
"in chain: \"EOF\"\n",
30243027
},
@@ -3031,7 +3034,8 @@ func TestErrorIs(t *testing.T) {
30313034
err: fmt.Errorf("abc: %w", errors.New("def")),
30323035
target: io.EOF,
30333036
result: false,
3034-
resultErrMsg: "Target error should be in err chain:\n" +
3037+
resultErrMsg: "" +
3038+
"Target error should be in err chain:\n" +
30353039
"expected: \"EOF\"\n" +
30363040
"in chain: \"abc: def\"\n" +
30373041
"\t\"def\"\n",
@@ -3058,15 +3062,17 @@ func TestNotErrorIs(t *testing.T) {
30583062
err: io.EOF,
30593063
target: io.EOF,
30603064
result: false,
3061-
resultErrMsg: "Target error should not be in err chain:\n" +
3065+
resultErrMsg: "" +
3066+
"Target error should not be in err chain:\n" +
30623067
"found: \"EOF\"\n" +
30633068
"in chain: \"EOF\"\n",
30643069
},
30653070
{
30663071
err: fmt.Errorf("wrap: %w", io.EOF),
30673072
target: io.EOF,
30683073
result: false,
3069-
resultErrMsg: "Target error should not be in err chain:\n" +
3074+
resultErrMsg: "" +
3075+
"Target error should not be in err chain:\n" +
30703076
"found: \"EOF\"\n" +
30713077
"in chain: \"wrap: EOF\"\n" +
30723078
"\t\"EOF\"\n",
@@ -3090,7 +3096,8 @@ func TestNotErrorIs(t *testing.T) {
30903096
err: nil,
30913097
target: nil,
30923098
result: false,
3093-
resultErrMsg: "Target error should not be in err chain:\n" +
3099+
resultErrMsg: "" +
3100+
"Target error should not be in err chain:\n" +
30943101
"found: \"\"\n" +
30953102
"in chain: \n",
30963103
},

0 commit comments

Comments
 (0)