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

Function test_policy_builder

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

Source from the content-addressed store, hash-verified

141
142#[test]
143fn 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]
156fn test_policy_check_allow() {

Callers

nothing calls this directly

Calls 3

askMethod · 0.80
denyMethod · 0.80
allowMethod · 0.80

Tested by

no test coverage detected