Skip to content

Commit

Permalink
Change tests to support rustc wording changes
Browse files Browse the repository at this point in the history
Between rust-lang/rust#126810 and rust-lang/rust#126810
the output of `rustc` for resolution errors is going to change in such a
way that some existing cargo tests will fail. Change them to support
both the current and future output, so that those PRs can land in
`rustc`.
  • Loading branch information
estebank authored and jneem committed Jul 15, 2024
1 parent a4ebae2 commit 3c74e99
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion tests/testsuite/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ fn rustc_check_err() {
.with_status(101)
.with_stderr_contains("[CHECKING] bar [..]")
.with_stderr_contains("[CHECKING] foo [..]")
.with_stderr_contains("[..]cannot find function `qux` in [..] `bar`")
.with_stderr_contains("[..]cannot find function `qux`[..]")
.with_stderr_contains("[..]in crate `bar`")
.run();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/message_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ test src/lib.rs - bar (line 1) ... FAILED
failures:
---- src/lib.rs - bar (line 1) stdout ----
src/lib.rs:2:1: error[E0425]: cannot find function `bar` in this scope
src/lib.rs:2:1: error[E0425]: cannot find function `bar`[..]
[ERROR] aborting due to 1 previous error
Couldn't compile the test.
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/metabuild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ fn metabuild_failed_build_json() {
"children": "{...}",
"code": "{...}",
"level": "error",
"message": "cannot find function `metabuild` in [..] `mb`",
"message": "cannot find function `metabuild`[..]",
"rendered": "{...}",
"spans": "{...}"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/replace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ fn override_respects_spec_metadata() {
[DOWNLOADED] bar v0.1.0+a (registry `dummy-registry`)
[CHECKING] bar v0.1.0+a
[CHECKING] foo v0.0.1 ([ROOT]/foo)
error[E0425]: cannot find function `bar` in crate `bar`
error[E0425]: cannot find function `bar`[..]
...
[ERROR] could not compile `foo` (lib) due to 1 previous error
Expand Down

0 comments on commit 3c74e99

Please sign in to comment.