Change message for identical time and add test for it

This commit is contained in:
Jan-Eric Nitschke authored and David Peter committed 2024-06-30 22:45:40 +02:00
1 parent 9134337b62
commit 13547e973c
2 files changed
+39 -10

No files matched your search

+18
View File
@@ -461,6 +461,24 @@ fn shows_benchmark_comparison_with_relative_times() {
);
}
#[test]
fn shows_benchmark_comparison_with_same_time() {
hyperfine_debug()
.arg("--command-name=A")
.arg("--command-name=B")
.arg("sleep 1.0")
.arg("sleep 1.0")
.arg("sleep 2.0")
.arg("sleep 1000.0")
.assert()
.success()
.stdout(
predicate::str::contains("As fast (1.00 ± 0.00) as")
.and(predicate::str::contains("2.00 ± 0.00 times faster"))
.and(predicate::str::contains("1000.00 ± 0.00 times faster")),
);
}
#[test]
fn shows_benchmark_comparison_relative_to_reference() {
hyperfine_debug()