Skip to content

Commit

Permalink
Rollup merge of #136504 - lqd:more-compare-modes, r=jieyouxu
Browse files Browse the repository at this point in the history
Fix last compare-mode false negatives in tests

This PR is a continuation of #136310 and fixes the last remaining cases of false negatives when running tests under a compare-mode.

With these normalizations, all the compare-mode failures in `next-solver` (and `polonius`) should now be real, actual differences in diagnostics.
  • Loading branch information
jhpratt authored Feb 4, 2025
2 parents 1baf59e + 62d0771 commit 9d563bb
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions tests/ui/crate-loading/crateresolve1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
//@ aux-build:crateresolve1-2.rs
//@ aux-build:crateresolve1-3.rs

//@ normalize-stderr: "\.nll/" -> "/"
//@ normalize-stderr: "crateresolve1\..+/auxiliary/" -> "crateresolve1/auxiliary/"
//@ normalize-stderr: "\\\?\\" -> ""
//@ normalize-stderr: "(lib)?crateresolve1-([123])\.[a-z]+" -> "libcrateresolve1-$2.somelib"

// NOTE: This test is duplicated at `tests/ui/error-codes/E0464.rs`.
// NOTE: This test is duplicated at `tests/ui/error-codes/E0464.rs` and `E0523.rs`.

extern crate crateresolve1;
//~^ ERROR multiple candidates for `rlib` dependency `crateresolve1` found
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/crate-loading/crateresolve2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//@ aux-build:crateresolve2-2.rs
//@ aux-build:crateresolve2-3.rs

//@ normalize-stderr: "\.nll/" -> "/"
//@ normalize-stderr: "crateresolve2\..+/auxiliary/" -> "crateresolve2/auxiliary/"
//@ normalize-stderr: "\\\?\\" -> ""

extern crate crateresolve2;
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/diagnostic-width/E0271.ascii.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ note: expected this to be `Foo`
LL | type Error = E;
| ^
= note: required for the cast from `Box<Result<..., ()>>` to `Box<...>`
= note: the full name for the type has been written to '$TEST_BUILD_DIR/diagnostic-width/E0271.ascii/E0271.long-type-hash.txt'
= note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
= note: consider using `--verbose` to print the full type name to the console

error: aborting due to 1 previous error
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/diagnostic-width/E0271.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ revisions: ascii unicode
//@[ascii] compile-flags: --diagnostic-width=40 -Zwrite-long-types-to-disk=yes
//@[unicode] compile-flags: -Zunstable-options --error-format=human-unicode --diagnostic-width=40 -Zwrite-long-types-to-disk=yes
//@ normalize-stderr: "long-type-\d+" -> "long-type-hash"
//@ normalize-stderr: "'\$TEST_BUILD_DIR/.*\.long-type-\d+.txt'" -> "'$$TEST_BUILD_DIR/$$FILE.long-type-hash.txt'"
trait Future {
type Error;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/diagnostic-width/E0271.unicode.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ note: expected this to be `Foo`
LL │ type Error = E;
│ ━
├ note: required for the cast from `Box<Result<..., ()>>` to `Box<...>`
├ note: the full name for the type has been written to '$TEST_BUILD_DIR/diagnostic-width/E0271.unicode/E0271.long-type-hash.txt'
├ note: the full name for the type has been written to '$TEST_BUILD_DIR/$FILE.long-type-hash.txt'
╰ note: consider using `--verbose` to print the full type name to the console

error: aborting due to 1 previous error
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/error-codes/E0462.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ aux-build:found-staticlib.rs

//@ normalize-stderr: "\.nll/" -> "/"
//@ normalize-stderr: "E0462\..+/auxiliary/" -> "E0462/auxiliary/"
//@ normalize-stderr: "\\\?\\" -> ""
//@ normalize-stderr: "(lib)?found_staticlib\.[a-z]+" -> "libfound_staticlib.somelib"

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/error-codes/E0464.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//@ aux-build:crateresolve1-2.rs
//@ aux-build:crateresolve1-3.rs

//@ normalize-stderr: "\.nll/" -> "/"
//@ normalize-stderr: "E0464\..+/auxiliary/" -> "E0464/auxiliary/"
//@ normalize-stderr: "\\\?\\" -> ""
//@ normalize-stderr: "(lib)?crateresolve1-([123])\.[a-z]+" -> "libcrateresolve1-$2.somelib"

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/error-codes/E0523.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//@ aux-build:crateresolve1-2.rs
//@ aux-build:crateresolve1-3.rs

//@ normalize-stderr: "\.nll/" -> "/"
//@ normalize-stderr: "E0523\..+/auxiliary/" -> "E0523/auxiliary/"
//@ normalize-stderr: "\\\?\\" -> ""
//@ normalize-stderr: "(lib)?crateresolve1-([123])\.[a-z]+" -> "libcrateresolve1-$2.somelib"

Expand Down
1 change: 1 addition & 0 deletions tests/ui/json/json-multiple.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ build-pass
//@ ignore-pass (different metadata emitted in different modes)
//@ compile-flags: --json=diagnostic-short --json artifacts --error-format=json
//@ normalize-stderr: "json-multiple\..+/libjson_multiple.rlib" -> "json-multiple/libjson_multiple.rlib"

#![crate_type = "lib"]
1 change: 1 addition & 0 deletions tests/ui/json/json-options.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//@ build-pass
//@ ignore-pass (different metadata emitted in different modes)
//@ compile-flags: --json=diagnostic-short,artifacts --error-format=json
//@ normalize-stderr: "json-options\..+/libjson_options.rlib" -> "json-options/libjson_options.rlib"

#![crate_type = "lib"]

0 comments on commit 9d563bb

Please sign in to comment.