diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-04-27 17:25:51 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-04-27 17:25:51 +0000 |
| commit | 2f70d02df46916a56f15ef52b13a99c3a69fbd5b (patch) | |
| tree | ca63d6b32bb6c203b2ff5e7b6a147e7001c85b14 | |
| parent | 26417a85e7551115146f98c64ea4e433453b9b4b (diff) | |
| download | rust-2f70d02df46916a56f15ef52b13a99c3a69fbd5b.tar.gz rust-2f70d02df46916a56f15ef52b13a99c3a69fbd5b.zip | |
Fix compile test so it normalizes (un)expected error messages
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index f6597c72938..514b96ce852 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1384,7 +1384,9 @@ impl<'test> TestCx<'test> { let actual_errors = json::parse_output(&diagnostic_file_name, &proc_res.stderr, proc_res); let mut unexpected = Vec::new(); let mut found = vec![false; expected_errors.len()]; - for actual_error in &actual_errors { + for mut actual_error in actual_errors { + actual_error.msg = self.normalize_output(&actual_error.msg, &[]); + let opt_index = expected_errors.iter().enumerate().position(|(index, expected_error)| { !found[index] @@ -1403,7 +1405,8 @@ impl<'test> TestCx<'test> { None => { // If the test is a known bug, don't require that the error is annotated - if self.is_unexpected_compiler_message(actual_error, expect_help, expect_note) { + if self.is_unexpected_compiler_message(&actual_error, expect_help, expect_note) + { self.error(&format!( "{}:{}: unexpected {}: '{}'", file_name, |
