Repository navigation
Integration test updates - #7196
matthewhughes934 wants to merge 6 commits into
Conversation
…, r=jieyouxu rustfmt subtree update 2026-10-05 Subtree update of `rustfmt` to rust-lang@4368801 Created using https://github.com/rust-lang/josh-sync. I wanted to get a little hands on experience with the new josh sync tooling. Overall it's so much nicer to use than the older patched git subtree setup we were using! A fairly small sync, with one fix to `wrap_comments` from rust-lang#7156. r? @jieyouxu
8e4b0a2 to
17eb303
Compare
This updates the rust-toolchain.toml file to nightly-2026-10-19 (b6eeb93c992027a03e1fd120b6652546396b142c).
Pull recent changes from https://github.com/rust-lang/rust via Josh. Previous upstream ref: rust-lang/rust@2822155 New upstream ref: rust-lang/rust@b6eeb93 Filtered ref: rust-lang/rustfmt@fab8d10 Upstream diff: rust-lang/rust@2822155...b6eeb93 This merge was created using https://github.com/rust-lang/josh-sync.
…ly-2026-10-19 Josh subtree pull nightly 2026-10-19
| // NOTE: existing the behaviour, possibly a bug | ||
| assert_eq!(&stdout, "\n"); |
There was a problem hiding this comment.
Huh, interesting... I feel like this is a bug, I sense that the .trim() you added later is just papering over the newline coming from somewhere.
There was a problem hiding this comment.
Huh, interesting... I feel like this is a bug, I sense that the .trim() you added later is just papering over the newline coming from somewhere.
Yeah, I plan to address this in a followup, just wanted to make this change about restructuring the tests
| remove_file("minimal-config").unwrap(); | ||
| } | ||
|
|
||
| // test writes to file within the repo, rust-lang/rust doesn't like that |
There was a problem hiding this comment.
Could we use a tempdir instead?
There was a problem hiding this comment.
Could we use a tempdir instead?
👍 Another one for my followup
| @@ -113,7 +113,16 @@ fn print_config_errors_minimal_without_input_file() { | |||
| #[test] | |||
| fn print_config_writes_to_file() { | |||
There was a problem hiding this comment.
Presumably we need to also make sure we remove the file if it existed -- otherwise you can get a false green locally from a previous run even if you completely break the logic.
There was a problem hiding this comment.
Presumably we need to also make sure we remove the file if it existed -- otherwise you can get a false green locally from a previous run even if you completely break the logic.
👍 yep, one more for the followup
|
Reminder, once the PR becomes ready for a review, use |
The main thing here is to be more explicit on assertions: e.g. to answer are we expecting something to be printed to stdout or stderr? I thought about rewriting the existing macro to handle this case too, but couldn't find a good approach for that, and decided that the plain code, while more lines, was more readable.
Firstly, Simplify the directory structure: we only need a single package here, so drag everything up for that. Secondly, make it more explicit exactly which config we expect to read by setting up configs with different options, rather than just ignoring all formatting. Also add tests for other existing behaviour: searching in `HOME` and `XDG_CONFIG_HOME` when no config is given nor found.
a30acc8 to
a8bf62d
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Rewrite
--print-configintegration testsThe main thing here is to be more explicit on assertions: e.g. to answer
are we expecting something to be printed to stdout or stderr?
I thought about rewriting the existing macro to handle this case too,
but couldn't find a good approach for that, and decided that the
plain code, while more lines, was more readable.
Update config discovery integration tests
Firstly, Simplify the directory structure: we only need a single package here,
so drag everything up for that. Secondly, make it more explicit exactly
which config we expect to read by setting up configs with different
options, rather than just ignoring all formatting.
Also add tests for other existing behaviour: searching in
HOMEandXDG_CONFIG_HOMEwhen no config is given nor found.I did not use an LLM to create a change in this PR.
I used an LLM to create a change in this PR, and I have explained below how it was used.