mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
test(test): Verify elapsed redaction
This commit is contained in:
parent
a10b3ca8b2
commit
5ed63926d3
@ -832,6 +832,10 @@ impl fmt::Debug for WildStr<'_> {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
|
use snapbox::assert_data_eq;
|
||||||
|
use snapbox::prelude::*;
|
||||||
|
use snapbox::str;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -960,4 +964,19 @@ B", false,
|
|||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn redact_elapsed_time() {
|
||||||
|
let mut subs = snapbox::Redactions::new();
|
||||||
|
add_regex_redactions(&mut subs);
|
||||||
|
|
||||||
|
assert_data_eq!(
|
||||||
|
subs.redact("[FINISHED] `release` profile [optimized] target(s) in 5.5s"),
|
||||||
|
str!["[FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s"].raw()
|
||||||
|
);
|
||||||
|
assert_data_eq!(
|
||||||
|
subs.redact("[FINISHED] `release` profile [optimized] target(s) in 1m 05s"),
|
||||||
|
str!["[FINISHED] `release` profile [optimized] target(s) in 1m 05s"].raw()
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user