safelog: tests for BoxSensitive.
This commit is contained in:
parent
993b4202c7
commit
417dda9547
|
@ -386,6 +386,23 @@ mod test {
|
|||
assert_eq!(s2, expect);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn box_sensitive() {
|
||||
let b: BoxSensitive<_> = "hello world".into();
|
||||
|
||||
assert_eq!(b.clone().into_inner(), "hello world");
|
||||
|
||||
let closure = || format!("{} {:?}", b, b);
|
||||
assert_eq!(closure(), "[scrubbed] [scrubbed]");
|
||||
assert_eq!(
|
||||
with_safe_logging_suppressed(closure),
|
||||
r#"hello world "hello world""#
|
||||
);
|
||||
|
||||
assert_eq!(b.len(), 11);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[serial]
|
||||
fn test_redacted() {
|
||||
|
|
Loading…
Reference in New Issue