-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Split up core/test/iter.rs into multiple files #76391
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
r? @cuviper who has done a lot with iterators so is likely better able to gauge if this splitting is the right one or even helpful :) |
I'm fine with the idea of splitting this up, but the current subdivisions don't make much sense to me. The rough principal I would use is how easy someone could guess where to find related test cases. Like, suppose I just fixed something in (At the end of the day, this will all be very subjective, but it's also just tests -- not an API we have to commit to.)
This group seems fine, but I'd probably just call it
There's one
That's fine for
This one is good, they're all range iterators.
This is ambiguous to me -- I wouldn't guess what to find in there, and it looks like quite a mix.
This too, I find unintuitive. I guess the point is that I don't really care what a test is doing, since they are usually invented scenarios that aren't the point. What matters is to group them by what they are testing. If I modify I think it's fine if these end up even smaller, rather than trying to define very broad groups. If it's too small (subjective), just leave it at the top level. |
You could just mirror the layout of |
☔ The latest upstream changes (presumably #76912) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
I've taken your suggestion to mirror the layout of I have tried to mirror it as close as I can, but it did get fuzzy. I decided to put tests relating to a trait or an adapter in the module corresponding to it. I also decided to add new modules for some things if they ended up in the modules I feel this is definitely a lot better from my first attempt, because they aren't split into broad groups anymore, and it did feel like that was a bit of an issue. :) |
This seems to be gone now, 404. |
Oh oops, I recently changed my name... |
@danii That breakdown looks good to me! |
@danii Ping from triage, this seems need a rebase to continue. Would you mind doing so? Thanks! |
@rustbot label -S-waiting-on-author +S-waiting-on-review After a season, this should be ready to rebase, I hope. |
☔ The latest upstream changes (presumably #81018) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #81152) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
It's difficult to be sure that nothing is lost, but I'm concerned that the net line count is reduced:
33 files changed, 3574 insertions(+), 3681 deletions(-)
If anything, I'd expect it to increase for the repetition of use
statements in each new file. At least some of the loss will be simple whitespace between functions though, which I would like to see fixed.
The job Click to see the possible cause of the failure (guessed by this bot)
|
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.
Looks great, thanks! The added documentation is very welcome too.
@bors r+ |
📌 Commit 0c78500 has been approved by |
Ay, nice! I know I sat on this pull request for too long, but now I'm feeling great. Thank you. |
☀️ Test successful - checks-actions |
This PR removes the
// ignore-tidy-filelength
at the top of iter.rs by splitting it into several sub files. I have split the file per test, based on what I felt the test was really trying to test.Addresses issue #60302.
"Programatically"
You may have noticed I "Programatically" split up the file. This is how I managed to do that. 😛 Hope that's fine.