MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_is_atomic_hook

Function test_is_atomic_hook

atomic-agent/src/hooks/claude_code/tests.rs:268–289  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

266
267 #[test]
268 fn test_is_atomic_hook() {
269 // Bare format (legacy)
270 assert!(is_atomic_hook("atomic agent hooks claude-code stop"));
271 assert!(is_atomic_hook(
272 "atomic agent hooks claude-code user-prompt-submit"
273 ));
274 // Guarded format (legacy, `.atomic`-only)
275 assert!(is_atomic_hook(
276 "test -d .atomic && atomic agent hooks claude-code stop || true"
277 ));
278 assert!(is_atomic_hook(
279 "test -d .atomic && atomic agent hooks claude-code user-prompt-submit || true"
280 ));
281 // Sandbox-aware guarded format (current)
282 assert!(is_atomic_hook(
283 "test -d .atomic || test -f .atomic-sandbox && atomic agent hooks claude-code stop || true"
284 ));
285 // Non-atomic commands
286 assert!(!is_atomic_hook("entire hooks claude-code stop"));
287 assert!(!is_atomic_hook("some other command"));
288 assert!(!is_atomic_hook(""));
289 }
290
291 #[test]
292 fn test_hook_command_exists_found() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected