Fix compile test so it normalizes (un)expected error messages

This commit is contained in:
Maybe Waffle 2023-04-27 17:25:51 +00:00
parent 26417a85e7
commit 2f70d02df4

View file

@ -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,