Remove extra newlines in test report and only print coverage on success.
This commit is contained in:
parent
cf86a20256
commit
6ba74125c7
|
@ -346,7 +346,7 @@ fn fmt_test(
|
||||||
let is_expected_failure = result.is_success();
|
let is_expected_failure = result.is_success();
|
||||||
|
|
||||||
test = format!(
|
test = format!(
|
||||||
"{test}\n{}\n{}{new_line}",
|
"{test}\n{}\n{}",
|
||||||
if is_expected_failure {
|
if is_expected_failure {
|
||||||
"★ counterexample"
|
"★ counterexample"
|
||||||
.if_supports_color(Stderr, |s| s.green())
|
.if_supports_color(Stderr, |s| s.green())
|
||||||
|
@ -375,13 +375,12 @@ fn fmt_test(
|
||||||
})
|
})
|
||||||
.collect::<Vec<String>>()
|
.collect::<Vec<String>>()
|
||||||
.join("\n"),
|
.join("\n"),
|
||||||
new_line = if result.logs().is_empty() { "\n" } else { "" },
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Labels
|
// Labels
|
||||||
if let TestResult::PropertyTestResult(PropertyTestResult { labels, .. }) = result {
|
if let TestResult::PropertyTestResult(PropertyTestResult { labels, .. }) = result {
|
||||||
if !labels.is_empty() {
|
if !labels.is_empty() && result.is_success() {
|
||||||
test = format!(
|
test = format!(
|
||||||
"{test}\n{title}",
|
"{test}\n{title}",
|
||||||
title = "· with coverage".if_supports_color(Stderr, |s| s.bold())
|
title = "· with coverage".if_supports_color(Stderr, |s| s.bold())
|
||||||
|
@ -412,7 +411,7 @@ fn fmt_test(
|
||||||
// Traces
|
// Traces
|
||||||
if !result.logs().is_empty() && result.is_success() {
|
if !result.logs().is_empty() && result.is_success() {
|
||||||
test = format!(
|
test = format!(
|
||||||
"{test}\n{title}\n{logs}\n",
|
"{test}\n{title}\n{logs}",
|
||||||
title = "· with traces".if_supports_color(Stderr, |s| s.bold()),
|
title = "· with traces".if_supports_color(Stderr, |s| s.bold()),
|
||||||
logs = result
|
logs = result
|
||||||
.logs()
|
.logs()
|
||||||
|
|
Loading…
Reference in New Issue