From 76bd292077fe642b7bf3d6571711e94a9853a00d Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 22 Nov 2017 17:33:26 -0500 Subject: [PATCH] extend MIR dump with detailed, extra information --- src/runtest.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/runtest.rs b/src/runtest.rs index 91d51d3..a18f4ec 100644 --- a/src/runtest.rs +++ b/src/runtest.rs @@ -2535,7 +2535,10 @@ impl<'test> TestCx<'test> { let mut dumped_file = fs::File::open(output_file.clone()).unwrap(); let mut dumped_string = String::new(); dumped_file.read_to_string(&mut dumped_string).unwrap(); - let mut dumped_lines = dumped_string.lines().filter(|l| !l.is_empty()); + let mut dumped_lines = dumped_string + .lines() + .map(|l| nocomment_mir_line(l)) + .filter(|l| !l.is_empty()); let mut expected_lines = expected_content .iter() .filter(|&l| { @@ -2573,7 +2576,7 @@ impl<'test> TestCx<'test> { .join("\n"); panic!( "Did not find expected line, error: {}\n\ - Actual Line: {:?}\n\ + Expected Line: {:?}\n\ Expected:\n{}\n\ Actual:\n{}", extra_msg, @@ -2599,7 +2602,9 @@ impl<'test> TestCx<'test> { error( expected_line, format!( - "Mismatch in lines\nCurrnt block: {}\nExpected Line: {:?}", + "Mismatch in lines\n\ + Current block: {}\n\ + Actual Line: {:?}", start_block_line.unwrap_or("None"), dumped_line ),