We noticed a confusing coverage result in #3119 where, for the code
fn print_direction(dir: Direction) {
// For some reason, `dir`'s span is reported as `UNCOVERED` too
match dir {
Direction::Up => println!("Going up!"),
Direction::Down => println!("Going down!"),
Direction::Left => println!("Going left!"),
Direction::Right if 1 == 1 => println!("Going right!"),
// This part is unreachable since we cover all variants in the match.
_ => println!("Not going anywhere!"),
}
}
we get the result
main.rs (print_direction)\
* 14:1 - 14:36 COVERED
* 16:11 - 16:14 UNCOVERED
* 17:26 - 17:47 UNCOVERED
* 18:28 - 18:51 UNCOVERED
* 19:28 - 19:51 COVERED
* 20:34 - 20:63 UNCOVERED
* 22:14 - 22:45 UNCOVERED
* 24:1 - 24:2 COVERED
which is confusing because it reports the dir in match dir { as UNCOVERED. It's not clear to me why this is happening, but we should at least check if this is also the case for a standard execution with coverage.
We noticed a confusing coverage result in #3119 where, for the code
we get the result
which is confusing because it reports the
dirinmatch dir {asUNCOVERED. It's not clear to me why this is happening, but we should at least check if this is also the case for a standard execution with coverage.