-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for the exact error class in all tests #71
Labels
Comments
Found this a little odd when I was extending the tests. I might have a swing at that. |
maksimov
added a commit
to maksimov/go-diff
that referenced
this issue
Dec 5, 2016
maksimov
added a commit
to maksimov/go-diff
that referenced
this issue
Dec 24, 2016
Code-review changes, update to an incorrectly worded error message
maksimov
added a commit
to maksimov/go-diff
that referenced
this issue
Apr 3, 2017
Code-review changes, update to an incorrectly worded error message
zimmski
added a commit
that referenced
this issue
Apr 9, 2017
Refactored error checking tests. Fixes #71
maksimov
added a commit
to maksimov/go-diff
that referenced
this issue
Apr 9, 2017
Code-review changes, update to an incorrectly worded error message
maksimov
added a commit
to maksimov/go-diff
that referenced
this issue
Apr 9, 2017
Code-review changes, update to an incorrectly worded error message
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checks like the following must be refactored
The problem is that we only check that the error is not nil, but we do not check for the error class. This means that any error lets the test pass even though it is possible that it was the wrong error.
One way to test for the error class is to simply check if assert.Contains if a part of the error string can be found. Another one is to add special error types, and another one is to use one of many encapsulating error packages.
The text was updated successfully, but these errors were encountered: