| 240 | |
| 241 | #[test] |
| 242 | fn test_policy_requires_confirmation() { |
| 243 | // Create a policy that explicitly allows Read but asks for Write |
| 244 | let mut policy = PermissionPolicy::new().allow("Read(*)").ask("Write(*)"); |
| 245 | policy.default_decision = PermissionDecision::Deny; // Make default deny to test ask rule |
| 246 | |
| 247 | assert!(policy.requires_confirmation("Write", &json!({"file_path": "/tmp/test"}))); |
| 248 | assert!(!policy.requires_confirmation("Read", &json!({"file_path": "/tmp/test"}))); |
| 249 | } |
| 250 | |
| 251 | #[test] |
| 252 | fn test_policy_matching_rules() { |