-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve assertion function signature
Based on community feedback in `testify`, it was observed that users often misuse assertion functions. Specifically, they mistakenly use an assertion function designed for a single parameter with two parameters, as shown below: assert.Error(t, expectedErr, actualErr, "bla bla bla") This leads to issues because the third argument for these functions is not meant for comparison but is a variadic assertion message argument. As a result, the `expectedErr` is checked if it's an error (which it is), and `actualErr` is treated as a failure assertion message. To address this, the function's signature has been modified to accept a fixed string-based type. This change ensures that such mistakes are caught during compilation due to type mismatches, making it harder for users to misuse the function.
- Loading branch information
Showing
15 changed files
with
202 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.