-
Notifications
You must be signed in to change notification settings - Fork 13.3k
consider linting test/run-pass/*.rs to ensure all have assert/assert_eq #23113
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
Comments
(of course, one cannot stop people from writing weak tests via such requirements, since they may just put in silly assertions. but then again, I think a silly assertion will stick out more during the review process than the absence of any assertion will.) |
Triage: no changes. |
I want to take a stab at doing this. Should I use regex to test the presence of assertions or is there a better way? |
I would either add this to compiletest ( If you want to implement this, feel free though. I think that we'll run into a lot of false positives, but I could be wrong. Let me know if there's anything we can help you with! |
Triage: I don't think anyone took mark up on his offer, as far as I know. |
I'm going to close this as I'm still not sure that this is entirely a good idea, in particular since we have ~1597 such files today. Generated the list (https://gist.github.com/Mark-Simulacrum/cb65bb73dcc43914f2aae416370ec83b) with:
|
spawned off of the story in #23112
We should consider making the compiletest system reject
run-pass
tests that contain no calls toassert!
norassert_eq!
(Better still would be to also reject if no such call is reached during an execution of the test, but that would probably require we add testing-specific assertion macros.)
We could add a comment flag to allow tests to opt out of this requirement (e.g. if they are regression tests that are indeed just checking that we do not segfault and do not have a clear assertion to include).
The text was updated successfully, but these errors were encountered: