Skip to content

Commit 2f70d02

Browse files
committed
Fix compile test so it normalizes (un)expected error messages
1 parent 26417a8 commit 2f70d02

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/tools/compiletest/src/runtest.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,9 @@ impl<'test> TestCx<'test> {
13841384
let actual_errors = json::parse_output(&diagnostic_file_name, &proc_res.stderr, proc_res);
13851385
let mut unexpected = Vec::new();
13861386
let mut found = vec![false; expected_errors.len()];
1387-
for actual_error in &actual_errors {
1387+
for mut actual_error in actual_errors {
1388+
actual_error.msg = self.normalize_output(&actual_error.msg, &[]);
1389+
13881390
let opt_index =
13891391
expected_errors.iter().enumerate().position(|(index, expected_error)| {
13901392
!found[index]
@@ -1403,7 +1405,8 @@ impl<'test> TestCx<'test> {
14031405

14041406
None => {
14051407
// If the test is a known bug, don't require that the error is annotated
1406-
if self.is_unexpected_compiler_message(actual_error, expect_help, expect_note) {
1408+
if self.is_unexpected_compiler_message(&actual_error, expect_help, expect_note)
1409+
{
14071410
self.error(&format!(
14081411
"{}:{}: unexpected {}: '{}'",
14091412
file_name,

0 commit comments

Comments
 (0)