Skip to content

Commit

Permalink
Fix tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkdp committed Aug 23, 2021
1 parent e71ff55 commit d31936e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn hyperfine() -> assert_cmd::Command {
fn hyperfine_runs_successfully() {
hyperfine()
.arg("--runs=2")
.arg("echo 'dummy benchmark'")
.arg("echo dummy benchmark")
.assert()
.success();
}
Expand All @@ -26,7 +26,7 @@ fn hyperfine_runs_successfully() {
fn at_least_two_runs_are_required() {
hyperfine()
.arg("--runs=1")
.arg("echo 'dummy benchmark'")
.arg("echo dummy benchmark")
.assert()
.failure();
}
Expand Down Expand Up @@ -59,7 +59,7 @@ impl ExecutionOrderTest {

fn get_command(&self, output: &str) -> String {
format!(
"echo '{output}' >> {path}",
"echo {output} >> {path}",
output = output,
path = self.logfile_path.to_string_lossy()
)
Expand All @@ -82,6 +82,12 @@ impl ExecutionOrderTest {

fn expect_output(&mut self, output: &str) -> &mut Self {
self.expected_content.push_str(output);

#[cfg(windows)]
{
self.expected_content.push_str(" \r");
}

self.expected_content.push('\n');
self
}
Expand Down

0 comments on commit d31936e

Please sign in to comment.