()
| 359 | |
| 360 | #[test] |
| 361 | fn test_custom_patterns() { |
| 362 | let mut config = DefaultSecurityConfig::default(); |
| 363 | config.custom_patterns.push(SensitivePattern::new( |
| 364 | "custom", |
| 365 | r"SECRET-\d{4}", |
| 366 | "REDACTED:CUSTOM", |
| 367 | )); |
| 368 | |
| 369 | let provider = DefaultSecurityProvider::with_config(config); |
| 370 | let text = "The code is SECRET-1234"; |
| 371 | let sanitized = provider.sanitize_output(text); |
| 372 | assert!(sanitized.contains("[REDACTED:CUSTOM]")); |
| 373 | } |
| 374 | |
| 375 | #[test] |
| 376 | fn test_multiple_patterns() { |
nothing calls this directly
no test coverage detected