-
Notifications
You must be signed in to change notification settings - Fork 8
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
fix: negative positive with type conversion #212
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 12617782863Details
💛 - Coveralls |
Hi, @ccoVeille Len call is not type conversion and we have separate helper for it. I expected:
|
I totally agree with you. What I don't get is that comment is irrelevant with the fix I'm doing here I used Len in the test because len was reported by the person who reported the bug. The problem is about avoiding suggesting to replace The replacement is OK when it's a numerical conversion. But when whatever is I hope it's clearer. I agree with the need of adding test to helpers, but I found none for other helpers, assuming you were not looking for it. I decided to do not fight this dragon. Feel free to add them. |
The code was too naive, and was stripping any code with only one arg
1841c4a
to
99f6156
Compare
I'm just noticing that the rules simplification by removing the unnecessary type conversion should/could also be applied to other asserter, such as Zero, Empty, Positive, Negative, Len (maybe with the limitations we already talked about) assert.Positive(t, int(42))
assert.Zero(t, int(42))
assert.Negative(t, uint(42))
... Here is a real life example Also the type conversion suggestion is only applied when using the Another way to consider this PR is to move out the type conversion from this PR and move it to another rule that could |
The code was too naive, and was stripping any code with only one arg
Fixes #210