mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-10-28 08:08:58 +00:00
Keep snapshot conversions limited to integration tests
This commit is contained in:
1 parent
1e2e0be25c
commit
c8f8c4ea5b
1 file changed
+281
-304
+281
-304
@@ -1,4 +1,4 @@
|
||||
use std::{fs, path::PathBuf};
|
||||
use std::{fs::File, io::Read, path::PathBuf};
|
||||
|
||||
use tempfile::{tempdir, TempDir};
|
||||
|
||||
@@ -7,6 +7,7 @@ use common::hyperfine;
|
||||
|
||||
struct ExecutionOrderTest {
|
||||
cmd: assert_cmd::Command,
|
||||
expected_content: String,
|
||||
logfile_path: PathBuf,
|
||||
#[allow(dead_code)]
|
||||
tempdir: TempDir,
|
||||
@@ -19,6 +20,7 @@ impl ExecutionOrderTest {
|
||||
|
||||
ExecutionOrderTest {
|
||||
cmd: hyperfine(),
|
||||
expected_content: String::new(),
|
||||
logfile_path,
|
||||
tempdir,
|
||||
}
|
||||
@@ -67,14 +69,26 @@ impl ExecutionOrderTest {
|
||||
self.command(output)
|
||||
}
|
||||
|
||||
fn run(&mut self) -> String {
|
||||
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
|
||||
}
|
||||
|
||||
fn run(&mut self) {
|
||||
self.cmd.assert().success();
|
||||
|
||||
let content = fs::read_to_string(&self.logfile_path).unwrap();
|
||||
// cmd.exe's echo includes the space before redirection and uses CRLF.
|
||||
#[cfg(windows)]
|
||||
let content = content.replace(" \r\n", "\n");
|
||||
content
|
||||
let mut f = File::open(&self.logfile_path).unwrap();
|
||||
let mut content = String::new();
|
||||
f.read_to_string(&mut content).unwrap();
|
||||
|
||||
assert_eq!(content, self.expected_content);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,186 +100,167 @@ impl Default for ExecutionOrderTest {
|
||||
|
||||
#[test]
|
||||
fn benchmarks_are_executed_sequentially_one() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--runs=1")
|
||||
.command("command 1")
|
||||
.command("command 2")
|
||||
.expect_output("command 1")
|
||||
.expect_output("command 2")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
command 1
|
||||
command 2
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn benchmarks_are_executed_sequentially() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--runs=2")
|
||||
.command("command 1")
|
||||
.command("command 2")
|
||||
.expect_output("command 1")
|
||||
.expect_output("command 1")
|
||||
.expect_output("command 2")
|
||||
.expect_output("command 2")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
command 1
|
||||
command 1
|
||||
command 2
|
||||
command 2
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn warmup_runs_are_executed_before_benchmarking_runs() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--runs=2")
|
||||
.arg("--warmup=3")
|
||||
.command("command 1")
|
||||
.expect_output("command 1")
|
||||
.expect_output("command 1")
|
||||
.expect_output("command 1")
|
||||
.expect_output("command 1")
|
||||
.expect_output("command 1")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
command 1
|
||||
command 1
|
||||
command 1
|
||||
command 1
|
||||
command 1
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn setup_commands_are_executed_before_each_series_of_timing_runs() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--runs=2")
|
||||
.setup("setup")
|
||||
.command("command 1")
|
||||
.command("command 2")
|
||||
.expect_output("setup")
|
||||
.expect_output("command 1")
|
||||
.expect_output("command 1")
|
||||
.expect_output("setup")
|
||||
.expect_output("command 2")
|
||||
.expect_output("command 2")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
setup
|
||||
command 1
|
||||
command 1
|
||||
setup
|
||||
command 2
|
||||
command 2
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn prepare_commands_are_executed_before_each_timing_run() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--runs=2")
|
||||
.prepare("prepare")
|
||||
.command("command 1")
|
||||
.command("command 2")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command 1")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command 1")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command 2")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command 2")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
prepare
|
||||
command 1
|
||||
prepare
|
||||
command 1
|
||||
prepare
|
||||
command 2
|
||||
prepare
|
||||
command 2
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn conclude_commands_are_executed_after_each_timing_run() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--runs=2")
|
||||
.conclude("conclude")
|
||||
.command("command 1")
|
||||
.command("command 2")
|
||||
.expect_output("command 1")
|
||||
.expect_output("conclude")
|
||||
.expect_output("command 1")
|
||||
.expect_output("conclude")
|
||||
.expect_output("command 2")
|
||||
.expect_output("conclude")
|
||||
.expect_output("command 2")
|
||||
.expect_output("conclude")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
command 1
|
||||
conclude
|
||||
command 1
|
||||
conclude
|
||||
command 2
|
||||
conclude
|
||||
command 2
|
||||
conclude
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn prepare_commands_are_executed_before_each_warmup() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--warmup=2")
|
||||
.arg("--runs=1")
|
||||
.prepare("prepare")
|
||||
.command("command 1")
|
||||
.command("command 2")
|
||||
// warmup 1
|
||||
.expect_output("prepare")
|
||||
.expect_output("command 1")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command 1")
|
||||
// benchmark 1
|
||||
.expect_output("prepare")
|
||||
.expect_output("command 1")
|
||||
// warmup 2
|
||||
.expect_output("prepare")
|
||||
.expect_output("command 2")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command 2")
|
||||
// benchmark 2
|
||||
.expect_output("prepare")
|
||||
.expect_output("command 2")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
prepare
|
||||
command 1
|
||||
prepare
|
||||
command 1
|
||||
prepare
|
||||
command 1
|
||||
prepare
|
||||
command 2
|
||||
prepare
|
||||
command 2
|
||||
prepare
|
||||
command 2
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn conclude_commands_are_executed_after_each_warmup() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--warmup=2")
|
||||
.arg("--runs=1")
|
||||
.conclude("conclude")
|
||||
.command("command 1")
|
||||
.command("command 2")
|
||||
// warmup 1
|
||||
.expect_output("command 1")
|
||||
.expect_output("conclude")
|
||||
.expect_output("command 1")
|
||||
.expect_output("conclude")
|
||||
// benchmark 1
|
||||
.expect_output("command 1")
|
||||
.expect_output("conclude")
|
||||
// warmup 2
|
||||
.expect_output("command 2")
|
||||
.expect_output("conclude")
|
||||
.expect_output("command 2")
|
||||
.expect_output("conclude")
|
||||
// benchmark 2
|
||||
.expect_output("command 2")
|
||||
.expect_output("conclude")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
command 1
|
||||
conclude
|
||||
command 1
|
||||
conclude
|
||||
command 1
|
||||
conclude
|
||||
command 2
|
||||
conclude
|
||||
command 2
|
||||
conclude
|
||||
command 2
|
||||
conclude
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cleanup_commands_are_executed_once_after_each_benchmark() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--runs=2")
|
||||
.cleanup("cleanup")
|
||||
.command("command 1")
|
||||
.command("command 2")
|
||||
.expect_output("command 1")
|
||||
.expect_output("command 1")
|
||||
.expect_output("cleanup")
|
||||
.expect_output("command 2")
|
||||
.expect_output("command 2")
|
||||
.expect_output("cleanup")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
command 1
|
||||
command 1
|
||||
cleanup
|
||||
command 2
|
||||
command 2
|
||||
cleanup
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn setup_prepare_cleanup_combined() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--warmup=1")
|
||||
.arg("--runs=2")
|
||||
.setup("setup")
|
||||
@@ -273,31 +268,30 @@ fn setup_prepare_cleanup_combined() {
|
||||
.command("command1")
|
||||
.command("command2")
|
||||
.cleanup("cleanup")
|
||||
// 1
|
||||
.expect_output("setup")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command1")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command1")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command1")
|
||||
.expect_output("cleanup")
|
||||
// 2
|
||||
.expect_output("setup")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command2")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command2")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command2")
|
||||
.expect_output("cleanup")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
setup
|
||||
prepare
|
||||
command1
|
||||
prepare
|
||||
command1
|
||||
prepare
|
||||
command1
|
||||
cleanup
|
||||
setup
|
||||
prepare
|
||||
command2
|
||||
prepare
|
||||
command2
|
||||
prepare
|
||||
command2
|
||||
cleanup
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn setup_prepare_conclude_cleanup_combined() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--warmup=1")
|
||||
.arg("--runs=2")
|
||||
.setup("setup")
|
||||
@@ -306,57 +300,53 @@ fn setup_prepare_conclude_cleanup_combined() {
|
||||
.command("command2")
|
||||
.conclude("conclude")
|
||||
.cleanup("cleanup")
|
||||
// 1
|
||||
.expect_output("setup")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command1")
|
||||
.expect_output("conclude")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command1")
|
||||
.expect_output("conclude")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command1")
|
||||
.expect_output("conclude")
|
||||
.expect_output("cleanup")
|
||||
// 2
|
||||
.expect_output("setup")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command2")
|
||||
.expect_output("conclude")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command2")
|
||||
.expect_output("conclude")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command2")
|
||||
.expect_output("conclude")
|
||||
.expect_output("cleanup")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
setup
|
||||
prepare
|
||||
command1
|
||||
conclude
|
||||
prepare
|
||||
command1
|
||||
conclude
|
||||
prepare
|
||||
command1
|
||||
conclude
|
||||
cleanup
|
||||
setup
|
||||
prepare
|
||||
command2
|
||||
conclude
|
||||
prepare
|
||||
command2
|
||||
conclude
|
||||
prepare
|
||||
command2
|
||||
conclude
|
||||
cleanup
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn single_parameter_value() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--runs=2")
|
||||
.arg("--parameter-list")
|
||||
.arg("number")
|
||||
.arg("1,2,3")
|
||||
.command("command {number}")
|
||||
.expect_output("command 1")
|
||||
.expect_output("command 1")
|
||||
.expect_output("command 2")
|
||||
.expect_output("command 2")
|
||||
.expect_output("command 3")
|
||||
.expect_output("command 3")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
command 1
|
||||
command 1
|
||||
command 2
|
||||
command 2
|
||||
command 3
|
||||
command 3
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn multiple_parameter_values() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--runs=2")
|
||||
.arg("--parameter-list")
|
||||
.arg("number")
|
||||
@@ -365,82 +355,70 @@ fn multiple_parameter_values() {
|
||||
.arg("letter")
|
||||
.arg("a,b")
|
||||
.command("command {number} {letter}")
|
||||
.expect_output("command 1 a")
|
||||
.expect_output("command 1 a")
|
||||
.expect_output("command 2 a")
|
||||
.expect_output("command 2 a")
|
||||
.expect_output("command 3 a")
|
||||
.expect_output("command 3 a")
|
||||
.expect_output("command 1 b")
|
||||
.expect_output("command 1 b")
|
||||
.expect_output("command 2 b")
|
||||
.expect_output("command 2 b")
|
||||
.expect_output("command 3 b")
|
||||
.expect_output("command 3 b")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
command 1 a
|
||||
command 1 a
|
||||
command 2 a
|
||||
command 2 a
|
||||
command 3 a
|
||||
command 3 a
|
||||
command 1 b
|
||||
command 1 b
|
||||
command 2 b
|
||||
command 2 b
|
||||
command 3 b
|
||||
command 3 b
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reference_is_executed_first() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--runs=1")
|
||||
.reference("reference")
|
||||
.command("command 1")
|
||||
.command("command 2")
|
||||
.expect_output("reference")
|
||||
.expect_output("command 1")
|
||||
.expect_output("command 2")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
reference
|
||||
command 1
|
||||
command 2
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reference_is_executed_first_parameter_value() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--runs=2")
|
||||
.reference("reference")
|
||||
.arg("--parameter-list")
|
||||
.arg("number")
|
||||
.arg("1,2,3")
|
||||
.command("command {number}")
|
||||
.expect_output("reference")
|
||||
.expect_output("reference")
|
||||
.expect_output("command 1")
|
||||
.expect_output("command 1")
|
||||
.expect_output("command 2")
|
||||
.expect_output("command 2")
|
||||
.expect_output("command 3")
|
||||
.expect_output("command 3")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
reference
|
||||
reference
|
||||
command 1
|
||||
command 1
|
||||
command 2
|
||||
command 2
|
||||
command 3
|
||||
command 3
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reference_is_executed_separately_from_commands() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--runs=1")
|
||||
.reference("command 1")
|
||||
.command("command 1")
|
||||
.command("command 2")
|
||||
.expect_output("command 1")
|
||||
.expect_output("command 1")
|
||||
.expect_output("command 2")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
command 1
|
||||
command 1
|
||||
command 2
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn setup_prepare_reference_conclude_cleanup_combined() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--warmup=1")
|
||||
.arg("--runs=2")
|
||||
.setup("setup")
|
||||
@@ -450,48 +428,48 @@ fn setup_prepare_reference_conclude_cleanup_combined() {
|
||||
.command("command2")
|
||||
.conclude("conclude")
|
||||
.cleanup("cleanup")
|
||||
// reference
|
||||
.expect_output("setup")
|
||||
.expect_output("prepare")
|
||||
.expect_output("reference")
|
||||
.expect_output("conclude")
|
||||
.expect_output("prepare")
|
||||
.expect_output("reference")
|
||||
.expect_output("conclude")
|
||||
.expect_output("prepare")
|
||||
.expect_output("reference")
|
||||
.expect_output("conclude")
|
||||
.expect_output("cleanup")
|
||||
// 1
|
||||
.expect_output("setup")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command1")
|
||||
.expect_output("conclude")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command1")
|
||||
.expect_output("conclude")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command1")
|
||||
.expect_output("conclude")
|
||||
.expect_output("cleanup")
|
||||
// 2
|
||||
.expect_output("setup")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command2")
|
||||
.expect_output("conclude")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command2")
|
||||
.expect_output("conclude")
|
||||
.expect_output("prepare")
|
||||
.expect_output("command2")
|
||||
.expect_output("conclude")
|
||||
.expect_output("cleanup")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
setup
|
||||
prepare
|
||||
reference
|
||||
conclude
|
||||
prepare
|
||||
reference
|
||||
conclude
|
||||
prepare
|
||||
reference
|
||||
conclude
|
||||
cleanup
|
||||
setup
|
||||
prepare
|
||||
command1
|
||||
conclude
|
||||
prepare
|
||||
command1
|
||||
conclude
|
||||
prepare
|
||||
command1
|
||||
conclude
|
||||
cleanup
|
||||
setup
|
||||
prepare
|
||||
command2
|
||||
conclude
|
||||
prepare
|
||||
command2
|
||||
conclude
|
||||
prepare
|
||||
command2
|
||||
conclude
|
||||
cleanup
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn setup_separate_prepare_separate_conclude_cleanup_combined() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--warmup=1")
|
||||
.arg("--runs=2")
|
||||
.setup("setup")
|
||||
@@ -502,37 +480,36 @@ fn setup_separate_prepare_separate_conclude_cleanup_combined() {
|
||||
.prepare("prepare2")
|
||||
.command("command2")
|
||||
.conclude("conclude2")
|
||||
// 1
|
||||
.expect_output("setup")
|
||||
.expect_output("prepare1")
|
||||
.expect_output("command1")
|
||||
.expect_output("conclude1")
|
||||
.expect_output("prepare1")
|
||||
.expect_output("command1")
|
||||
.expect_output("conclude1")
|
||||
.expect_output("prepare1")
|
||||
.expect_output("command1")
|
||||
.expect_output("conclude1")
|
||||
.expect_output("cleanup")
|
||||
// 2
|
||||
.expect_output("setup")
|
||||
.expect_output("prepare2")
|
||||
.expect_output("command2")
|
||||
.expect_output("conclude2")
|
||||
.expect_output("prepare2")
|
||||
.expect_output("command2")
|
||||
.expect_output("conclude2")
|
||||
.expect_output("prepare2")
|
||||
.expect_output("command2")
|
||||
.expect_output("conclude2")
|
||||
.expect_output("cleanup")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
setup
|
||||
prepare1
|
||||
command1
|
||||
conclude1
|
||||
prepare1
|
||||
command1
|
||||
conclude1
|
||||
prepare1
|
||||
command1
|
||||
conclude1
|
||||
cleanup
|
||||
setup
|
||||
prepare2
|
||||
command2
|
||||
conclude2
|
||||
prepare2
|
||||
command2
|
||||
conclude2
|
||||
prepare2
|
||||
command2
|
||||
conclude2
|
||||
cleanup
|
||||
");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn setup_separate_prepare_reference_separate_conclude_cleanup_combined() {
|
||||
let output = ExecutionOrderTest::new()
|
||||
ExecutionOrderTest::new()
|
||||
.arg("--warmup=1")
|
||||
.arg("--runs=2")
|
||||
.setup("setup")
|
||||
@@ -546,41 +523,41 @@ fn setup_separate_prepare_reference_separate_conclude_cleanup_combined() {
|
||||
.prepare("prepare2")
|
||||
.command("command2")
|
||||
.conclude("conclude2")
|
||||
// reference
|
||||
.expect_output("setup")
|
||||
.expect_output("prepareref")
|
||||
.expect_output("reference")
|
||||
.expect_output("concluderef")
|
||||
.expect_output("prepareref")
|
||||
.expect_output("reference")
|
||||
.expect_output("concluderef")
|
||||
.expect_output("prepareref")
|
||||
.expect_output("reference")
|
||||
.expect_output("concluderef")
|
||||
.expect_output("cleanup")
|
||||
// 1
|
||||
.expect_output("setup")
|
||||
.expect_output("prepare1")
|
||||
.expect_output("command1")
|
||||
.expect_output("conclude1")
|
||||
.expect_output("prepare1")
|
||||
.expect_output("command1")
|
||||
.expect_output("conclude1")
|
||||
.expect_output("prepare1")
|
||||
.expect_output("command1")
|
||||
.expect_output("conclude1")
|
||||
.expect_output("cleanup")
|
||||
// 2
|
||||
.expect_output("setup")
|
||||
.expect_output("prepare2")
|
||||
.expect_output("command2")
|
||||
.expect_output("conclude2")
|
||||
.expect_output("prepare2")
|
||||
.expect_output("command2")
|
||||
.expect_output("conclude2")
|
||||
.expect_output("prepare2")
|
||||
.expect_output("command2")
|
||||
.expect_output("conclude2")
|
||||
.expect_output("cleanup")
|
||||
.run();
|
||||
|
||||
insta::assert_snapshot!(output, @r"
|
||||
setup
|
||||
prepareref
|
||||
reference
|
||||
concluderef
|
||||
prepareref
|
||||
reference
|
||||
concluderef
|
||||
prepareref
|
||||
reference
|
||||
concluderef
|
||||
cleanup
|
||||
setup
|
||||
prepare1
|
||||
command1
|
||||
conclude1
|
||||
prepare1
|
||||
command1
|
||||
conclude1
|
||||
prepare1
|
||||
command1
|
||||
conclude1
|
||||
cleanup
|
||||
setup
|
||||
prepare2
|
||||
command2
|
||||
conclude2
|
||||
prepare2
|
||||
command2
|
||||
conclude2
|
||||
prepare2
|
||||
command2
|
||||
conclude2
|
||||
cleanup
|
||||
");
|
||||
}
|
||||
Reference in new issue
Block a user