()
| 141 | |
| 142 | #[test] |
| 143 | fn test_policy_builder() { |
| 144 | let policy = PermissionPolicy::new() |
| 145 | .allow("Bash(cargo:*)") |
| 146 | .allow("Grep(*)") |
| 147 | .deny("Bash(rm -rf:*)") |
| 148 | .ask("Write(*)"); |
| 149 | |
| 150 | assert_eq!(policy.allow.len(), 2); |
| 151 | assert_eq!(policy.deny.len(), 1); |
| 152 | assert_eq!(policy.ask.len(), 1); |
| 153 | } |
| 154 | |
| 155 | #[test] |
| 156 | fn test_policy_check_allow() { |