Add regression test for #642

This commit is contained in:
David Peter authored and David Peter committed 2023-04-20 13:22:00 +02:00
1 parent 9859ecaafe
commit 4b9cd06d86
1 file changed
+21
+21
View File
@@ -361,3 +361,24 @@ fn intermediate_results_are_not_exported_to_stdout() {
.and(predicate::str::contains("sleep 2").count(1)),
);
}
#[test]
#[cfg(unix)]
fn exports_intermediate_results_to_file() {
use tempfile::tempdir;
let tempdir = tempdir().unwrap();
let export_path = tempdir.path().join("results.md");
hyperfine()
.arg("--runs=1")
.arg("--export-markdown")
.arg(&export_path)
.arg("true")
.arg("false")
.assert()
.failure();
let contents = std::fs::read_to_string(export_path).unwrap();
assert!(contents.contains("true"));
}