Provide intermediate feedback during property test runs.

Avoid the interface to hang for several seconds without feedback when counterexamples are being simplified. This sends a heads-up to the user to indicate that a research of a counter example is going on.
This commit is contained in:
KtorZ
2024-09-19 20:18:34 +02:00
parent 91843b2c0e
commit 3f149ab346
3 changed files with 80 additions and 7 deletions

View File

@@ -168,7 +168,7 @@ impl EventListener for Terminal {
}
Event::RunningTests => {
eprintln!(
"{} {}\n",
"{} {}",
" Testing"
.if_supports_color(Stderr, |s| s.bold())
.if_supports_color(Stderr, |s| s.purple()),
@@ -205,7 +205,7 @@ impl EventListener for Terminal {
let summary = format!("{}{}", seed_info, fmt_test_summary(results, true));
println!(
"{}\n",
"\n{}",
pretty::indent(
&pretty::open_box(&title, &tests, &summary, |border| border
.if_supports_color(Stderr, |s| s.bright_black())
@@ -214,6 +214,10 @@ impl EventListener for Terminal {
)
);
}
if !tests.is_empty() {
println!();
}
}
Event::ResolvingPackages { name } => {
eprintln!(