()
| 481 | |
| 482 | #[test] |
| 483 | fn 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] |
| 496 | fn test_matching_rules_is_empty() { |