MCPcopy Index your code
hub / github.com/AI45Lab/Code / test_custom_patterns

Function test_custom_patterns

core/src/security/default.rs:361–373  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 1

sanitize_outputMethod · 0.45

Tested by

no test coverage detected