fix(cli): count skipped tests correctly

This commit is contained in:
Gabriel Holodak 2024-12-15 14:10:18 -05:00 committed by Amaan Qureshi
parent 8de3a2ee13
commit f279d10aa2

View file

@ -362,6 +362,7 @@ fn run_tests(
opts.test_num,
paint(opts.color.then_some(AnsiColor::Yellow), &name),
);
opts.test_num += 1;
return Ok(true);
}
@ -371,6 +372,7 @@ fn run_tests(
opts.test_num,
paint(opts.color.then_some(AnsiColor::Magenta), &name),
);
opts.test_num += 1;
return Ok(true);
}
@ -529,7 +531,6 @@ fn run_tests(
let mut advance_counter = opts.test_num;
let failure_count = failures.len();
let mut has_printed = false;
let mut skipped_tests = 0;
let matches_filter = |name: &str, opts: &TestOptions| {
if let Some(include) = &opts.include {
@ -576,7 +577,6 @@ fn run_tests(
));
opts.test_num += 1;
skipped_tests += 1;
continue;
}
@ -600,8 +600,6 @@ fn run_tests(
}
}
opts.test_num += skipped_tests;
if let Some(file_path) = file_path {
if opts.update && failures.len() - failure_count > 0 {
write_tests(&file_path, corrected_entries)?;