MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_serialization

Function test_serialization

core/src/permissions/tests.rs:483–493  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

481
482#[test]
483fn test_serialization() {
484 let policy = PermissionPolicy::new()
485 .allow("Bash(cargo:*)")
486 .deny("Bash(rm:*)");
487
488 let json = serde_json::to_string(&policy).unwrap();
489 let deserialized: PermissionPolicy = serde_json::from_str(&json).unwrap();
490
491 assert_eq!(deserialized.allow.len(), 1);
492 assert_eq!(deserialized.deny.len(), 1);
493}
494
495#[test]
496fn test_matching_rules_is_empty() {

Callers

nothing calls this directly

Calls 2

denyMethod · 0.80
allowMethod · 0.80

Tested by

no test coverage detected