Skip to content

Commit dd90b4d

Browse files
committed
Extract Console::discovered_mutants
1 parent dd0a853 commit dd90b4d

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/console.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ impl Console {
114114
));
115115
}
116116

117+
/// Update that we discovered some mutants to test.
118+
pub fn discovered_mutants(&self, mutants: &[Mutant]) {
119+
self.message(&format!(
120+
"Found {} to test\n",
121+
plural(mutants.len(), "mutant")
122+
));
123+
}
124+
117125
/// Update that work is starting on testing a given number of mutants.
118126
pub fn start_testing_mutants(&self, n_mutants: usize) {
119127
self.view.update(|model| {

src/lab.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use tracing::error;
1313
use tracing::{debug, info};
1414

1515
use crate::cargo::{cargo_argv, run_cargo, CargoSourceTree};
16-
use crate::console::{plural, Console};
16+
use crate::console::Console;
1717
use crate::outcome::{LabOutcome, Phase, ScenarioOutcome};
1818
use crate::output::OutputDir;
1919
use crate::*;
@@ -42,10 +42,7 @@ pub fn test_unmutated_then_all_mutants(
4242
mutants.shuffle(&mut rand::thread_rng());
4343
}
4444
output_dir.write_mutants_list(&mutants)?;
45-
console.message(&format!(
46-
"Found {} to test\n",
47-
plural(mutants.len(), "mutant")
48-
));
45+
console.discovered_mutants(&mutants);
4946
if mutants.is_empty() {
5047
return Err(anyhow!("No mutants found"));
5148
}

0 commit comments

Comments
 (0)