Skip to content

Commit

Permalink
Add regression test for #642
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkdp committed Apr 20, 2023
1 parent 9859eca commit 4b9cd06
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

0 comments on commit 4b9cd06

Please sign in to comment.