-
Notifications
You must be signed in to change notification settings - Fork 962
test: finish migration to .expect()
APIs
#4376
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
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.
Pull Request Overview
This PR completes the migration of the test suite to the new .expect()
APIs and cleans up related helper code.
- Updated all test modules (
cli_self_upd
,cli_rustup
,cli_misc
, andcli_exact
) to use the.expect()
/.expect_with_env()
pattern with chained.await
,.is_ok()
/.is_err()
, and.with_stdout()
/.with_stderr()
. - Enhanced the
Assert
type insrc/test/clitools.rs
withredact()
andremove_redactions()
methods, removed deprecated assertion helpers, and made itsoutput
field public. - Removed the now-unneeded
similar_asserts
dependency and deprecatedrun()
-based helpers fromConfig
, updatingCargo.toml
accordingly.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
tests/suite/cli_self_upd.rs | Switched to .expect() API and cleaned up redactions |
tests/suite/cli_rustup.rs | Replaced run() with .expect*() calls and simplified redaction args |
tests/suite/cli_misc.rs | Introduced assert_ok_with_paths helper and moved to .expect() API |
tests/suite/cli_exact.rs | Converted pre-test run() calls to .expect(...).is_ok() |
src/test/clitools.rs | Added redact /remove_redactions , exposed output , removed deprecated helpers |
Cargo.toml | Dropped similar-asserts from the test feature |
@@ -1393,10 +1393,27 @@ async fn override_by_toolchain_on_the_command_line() { | |||
|
|||
"#]]) | |||
.is_ok(); | |||
cx.config |
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.
These assertions were accidentally deleted by me in the previous PR #4363, the original intent being merging Windows and Unix tests now that snapbox
would automatically replace \
with /
. However, I obviously deleted more than what was needed...
2ab9d63
to
bddde00
Compare
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 good to me! And thank you for completing this whole migration 🎉
@ChrisDenton Many thanks to you and @djc for the review as well! 🙏 |
Closes #4359.
SemanticDiff