Skip to content

Commit

Permalink
extend MIR dump with detailed, extra information
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Dec 7, 2017
1 parent 00f118e commit 76bd292
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| {
Expand Down Expand Up @@ -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,
Expand All @@ -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
),
Expand Down

0 comments on commit 76bd292

Please sign in to comment.