Skip to content

Commit ed02773

Browse files
committed
test: Allow redact file size w/o fraction
`cargo clean` shows file size without fraction in summary when the size is lower than 1024. And we need to avoid matching things like `%2B%23..` found in other test cases, the trailing `\s` is added to regex.
1 parent 1794ce4 commit ed02773

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/cargo-test-support/src/compare.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ fn add_common_redactions(subs: &mut snapbox::Redactions) {
171171
.unwrap();
172172
subs.insert(
173173
"[FILE_SIZE]",
174-
regex!(r"(?<redacted>[0-9]+(\.[0-9]+)([a-zA-Z]i)?)B"),
174+
regex!(r"(?<redacted>[0-9]+(\.[0-9]+)?([a-zA-Z]i)?)B\s"),
175175
)
176176
.unwrap();
177177
subs.insert(

0 commit comments

Comments
 (0)