()
| 250 | |
| 251 | #[test] |
| 252 | fn test_policy_matching_rules() { |
| 253 | let policy = PermissionPolicy::new() |
| 254 | .allow("Bash(cargo:*)") |
| 255 | .deny("Bash(cargo fmt:*)") |
| 256 | .ask("Bash(*)"); |
| 257 | |
| 258 | let matching = policy.get_matching_rules("Bash", &json!({"command": "cargo fmt"})); |
| 259 | assert_eq!(matching.deny.len(), 1); |
| 260 | assert_eq!(matching.allow.len(), 1); |
| 261 | assert_eq!(matching.ask.len(), 1); |
| 262 | } |
| 263 | |
| 264 | #[test] |
| 265 | fn test_policy_allow_all() { |
nothing calls this directly
no test coverage detected