mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-02 01:00:31 +00:00
Add regression test for #642
This commit is contained in:
1 parent
9859ecaafe
commit
4b9cd06d86
1 file changed
+21
@@ -361,3 +361,24 @@ fn intermediate_results_are_not_exported_to_stdout() {
|
|||||||
.and(predicate::str::contains("sleep 2").count(1)),
|
.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"));
|
||||||
|
}
|
||||||
Reference in new issue
Block a user