-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore: Reduce repetition in the parameter type inference tests #16079
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
chore: Reduce repetition in the parameter type inference tests #16079
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jsai28 -- this looks great!
Would you be willing to refactor the remaining tests in this file to use the new structure? We can do it as a follow on PR too I think
@alamb Yep I just need to fix that clippy issue and then I'll add it to the rest of the tests. I'll probably just do it in this PR itself |
#[allow(clippy::needless_lifetimes)] | ||
impl<'a> ParameterTest<'a> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can avoid the clippy issue with something like this:
#[allow(clippy::needless_lifetimes)] | |
impl<'a> ParameterTest<'a> { | |
impl ParameterTest<'_> { |
…n-the-parameter-type-inference-tests
…n-the-parameter-type-inference-tests
@alamb I think this is ready for review. I converted all of the tests in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so great -- thank you very much @jsai28 . Adding new tests and maintaining existing tests is going to be so much easier with this structure
Which issue does this PR close?
Closes #16057.
Rationale for this change
Reduces repetition in the parameter type inference tests
What changes are included in this PR?
Added a
ParameterTest
type to easily create parameter type inference tests.Are these changes tested?
Tests run successfully.
Are there any user-facing changes?
No.