Fix compile test so it normalizes (un)expected error messages
This commit is contained in:
parent
26417a85e7
commit
2f70d02df4
1 changed files with 5 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue