-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
test: with_stderr_(data|contains)
has no effect when chained with run_expect_error()
#14076
Labels
A-testing-cargo-itself
Area: cargo's tests
C-bug
Category: bug
E-easy
Experience: Easy
S-accepted
Status: Issue or feature is accepted, and has a team member available to help mentor or review
Comments
choznerol
added a commit
to choznerol/cargo
that referenced
this issue
Jun 15, 2024
I tend to remove .with_status(101) // or other exit code
.with_{stderr,stdout}_data(str![....])
.run() |
Thanks! Let me make a PR to fix the 3 tests and remove |
choznerol
added a commit
to choznerol/cargo
that referenced
this issue
Jun 15, 2024
The `with_stderr_contains()` (as well as the new `with_stderr_data()` too, see rust-lang#14060) has no effect when using with `run_expect_error()`.
choznerol
added a commit
to choznerol/cargo
that referenced
this issue
Jun 15, 2024
choznerol
added a commit
to choznerol/cargo
that referenced
this issue
Jun 15, 2024
This reverts commit 18f4c3f.
choznerol
added a commit
to choznerol/cargo
that referenced
this issue
Jun 15, 2024
choznerol
added a commit
to choznerol/cargo
that referenced
this issue
Jun 15, 2024
choznerol
added a commit
to choznerol/cargo
that referenced
this issue
Jun 16, 2024
The `with_stderr_contains()` (as well as the new `with_stderr_data()` too, see rust-lang#14060) has no effect when using with `run_expect_error()`.
choznerol
added a commit
to choznerol/cargo
that referenced
this issue
Jun 16, 2024
choznerol
added a commit
to choznerol/cargo
that referenced
this issue
Jun 16, 2024
This reverts commit 18f4c3f.
choznerol
added a commit
to choznerol/cargo
that referenced
this issue
Jun 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-testing-cargo-itself
Area: cargo's tests
C-bug
Category: bug
E-easy
Experience: Easy
S-accepted
Status: Issue or feature is accepted, and has a team member available to help mentor or review
Problem
While working on #14060, I noticed a test case with both
with_stderr_contains
andrun_expect_error
would always pass no matter what's passed towith_stderr_contains(...)
.The all 3 usages of
run_expect_error
in the codebase have the same false positive issue: choznerol@18f4c3fSteps
cargo test --test testsuite help_alias; cargo test --test testsuite config_invalid_empty; cargo test --test testsuite use_mtime_cache_in_cargo_home;
. All 3 tests should pass.with_stderr_contains
. Rerun step 1 and notice all 3 tests still passed.with_stderr_contains
withwith_stderr_data
. To validate this, you may checkout test: migratehelp
to snapbox #14060 and runcargo test --test testsuite help_alias
.Possible Solution(s)
No response
Notes
No response
Version
The text was updated successfully, but these errors were encountered: