frankban / quicktest

Quick helpers for testing Go applications
MIT License
529 stars 27 forks source link

Fix ErrorIs for nil values #123

Closed dsnet closed 2 years ago

dsnet commented 2 years ago

If both the LHS and the RHS are nil, then ErrorIs should treat them as equal.

For example: c.Assert(nil, qt.ErrorIs, nil) should succeed.

If the LHS is non-nil, and the RHS is nil, then ErrorIs should treat the RHS as an error.

For example: c.Assert(io.EOF, qt.ErrorIs, nil) should fail due to io.EOF not being part of the error chain of nil, rather than nil not being a valid error value.

dsnet commented 2 years ago

I found another minor bug. I'm going to add it to this PR.

frankban commented 2 years ago

Tagged as v1.14.1.