From 0375bc98a65f157a70dd219480d32b94943dcb59 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sun, 7 Apr 2024 22:45:35 +0200 Subject: [PATCH] dd: fix flaky test_null_stats If the first four decimal digits are zero, GNU dd elides them altogether. Therefore, this test just contained an overly-strict regex. See also ede944e1f856cc0011852a25d6826b9eac6f2f11. --- tests/by-util/test_dd.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/by-util/test_dd.rs b/tests/by-util/test_dd.rs index a3b007909e5..a8cb0aa6473 100644 --- a/tests/by-util/test_dd.rs +++ b/tests/by-util/test_dd.rs @@ -396,7 +396,7 @@ fn test_null_stats() { .arg("if=null.txt") .run() .stderr_contains("0+0 records in\n0+0 records out\n0 bytes copied, ") - .stderr_matches(&Regex::new(r"\d\.\d+(e-\d\d)? s, ").unwrap()) + .stderr_matches(&Regex::new(r"\d(\.\d+)?(e-\d\d)? s, ").unwrap()) .stderr_contains("0.0 B/s") .success(); }