refactor: tests: add remaining tests (multi-command ones) besides ones with select#1619
Open
refactor: tests: add remaining tests (multi-command ones) besides ones with select#1619
select#1619Conversation
autoretype_array to a snapshot test
kkysen
commented
Feb 25, 2026
Contributor
Author
kkysen
left a comment
There was a problem hiding this comment.
Does this look like it should work? I'll add the rest of them if so.
0591e9d to
a266f30
Compare
ahomescu
reviewed
Feb 25, 2026
ahomescu
approved these changes
Feb 25, 2026
Base automatically changed from
kkysen/refactor-tests-should_panic
to
master
February 26, 2026 06:05
`git` didn't recognize this as a pure move, but it is. This runs multiple refactor commands with just multiple `refactor(...).test()`s. This generates a separate snapshot for each command, but this should be fine, and gives us more data to inspect if anything goes wrong. The old test used `;` for this, which avoids running the refactorer again. Now we run the refactorer from scratch for each command. This avoids the need to `commit` in between certain commands in order to re-evaluate the AST, as `commit` is broken (see #1605).
`git` didn't recognize this as a pure move, but it is.
a266f30 to
1796af0
Compare
It appears this test is now broken, as the generated `fn add` is marked `unsafe` when it doesn't appear it should be.
`git` didn't recognize this as a pure move, but it is. This test was supposed to test if changes are visible across `commit`s, even when those changes aren't written to the original file (like with the `--rewrite-mode alongside` used by [`refactor`], and unlike with `--rewrite-mode inplace`). However, `commit` is currently broken (see #1605), so this test is not actually testing what it's meant to. The places where `commit`s are supposed to go are left as comments for now until we fix `commit`.
kkysen
commented
Feb 27, 2026
| "x - y", | ||
| ]) | ||
| .named("abstract.new") | ||
| .expect_compile_error(true) |
Contributor
Author
There was a problem hiding this comment.
@ahomescu, see, it turned out to be useful to keep for a second command.
select
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds all multi-command refactor tests besides tests with
select.This runs multiple refactor commands with just multiple
refactor(...).test()s. This generates a separate snapshot for each command, but this should be fine, and gives us more data to inspect if anything goes wrong.The old tests used
;for this, which avoids running the refactorer again. Now we run the refactorer from scratch for each command. This avoids the need tocommitin between certain commands in order to re-evaluate the AST, ascommitis broken (see #1605).