Skip to content

Commit

Permalink
Improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
craig65535 committed Oct 31, 2023
1 parent 2a2e4e0 commit 1dde955
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions assert/assertions_test.go
Expand Up @@ -3002,23 +3002,26 @@ func TestErrorIs(t *testing.T) {
err: io.EOF,
target: io.ErrClosedPipe,
result: false,
resultErrMsg: "Target error should be in err chain:\n" +
resultErrMsg: "" +
"Target error should be in err chain:\n" +
"expected: \"io: read/write on closed pipe\"\n" +
"in chain: \"EOF\"\n",
},
{
err: nil,
target: io.EOF,
result: false,
resultErrMsg: "Target error should be in err chain:\n" +
resultErrMsg: "" +
"Target error should be in err chain:\n" +
"expected: \"EOF\"\n" +
"in chain: \n",
},
{
err: io.EOF,
target: nil,
result: false,
resultErrMsg: "Target error should be in err chain:\n" +
resultErrMsg: "" +
"Target error should be in err chain:\n" +
"expected: \"\"\n" +
"in chain: \"EOF\"\n",
},
Expand All @@ -3031,7 +3034,8 @@ func TestErrorIs(t *testing.T) {
err: fmt.Errorf("abc: %w", errors.New("def")),
target: io.EOF,
result: false,
resultErrMsg: "Target error should be in err chain:\n" +
resultErrMsg: "" +
"Target error should be in err chain:\n" +
"expected: \"EOF\"\n" +
"in chain: \"abc: def\"\n" +
"\t\"def\"\n",
Expand All @@ -3058,15 +3062,17 @@ func TestNotErrorIs(t *testing.T) {
err: io.EOF,
target: io.EOF,
result: false,
resultErrMsg: "Target error should not be in err chain:\n" +
resultErrMsg: "" +
"Target error should not be in err chain:\n" +
"found: \"EOF\"\n" +
"in chain: \"EOF\"\n",
},
{
err: fmt.Errorf("wrap: %w", io.EOF),
target: io.EOF,
result: false,
resultErrMsg: "Target error should not be in err chain:\n" +
resultErrMsg: "" +
"Target error should not be in err chain:\n" +
"found: \"EOF\"\n" +
"in chain: \"wrap: EOF\"\n" +
"\t\"EOF\"\n",
Expand All @@ -3090,7 +3096,8 @@ func TestNotErrorIs(t *testing.T) {
err: nil,
target: nil,
result: false,
resultErrMsg: "Target error should not be in err chain:\n" +
resultErrMsg: "" +
"Target error should not be in err chain:\n" +
"found: \"\"\n" +
"in chain: \n",
},
Expand Down

0 comments on commit 1dde955

Please sign in to comment.