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

Function test_is_atomic_hook

atomic-agent/src/hooks/gemini_cli.rs:1117–1138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1115
1116 #[test]
1117 fn test_is_atomic_hook() {
1118 // Bare (legacy) format
1119 assert!(is_atomic_hook(
1120 "atomic agent hooks gemini-cli session-start"
1121 ));
1122 assert!(is_atomic_hook("atomic agent hooks gemini-cli after-agent"));
1123 // Guarded format (legacy, `.atomic`-only)
1124 assert!(is_atomic_hook(
1125 "test -d .atomic && atomic agent hooks gemini-cli session-start || true"
1126 ));
1127 assert!(is_atomic_hook(
1128 "test -d .atomic && atomic agent hooks gemini-cli after-agent || true"
1129 ));
1130 // Sandbox-aware guarded format (current)
1131 assert!(is_atomic_hook(
1132 "test -d .atomic || test -f .atomic-sandbox && atomic agent hooks gemini-cli session-start || true"
1133 ));
1134 // Non-atomic
1135 assert!(!is_atomic_hook("my-custom-hook --on-stop"));
1136 assert!(!is_atomic_hook("atomic agent hooks claude-code stop"));
1137 assert!(!is_atomic_hook(""));
1138 }
1139
1140 #[test]
1141 fn test_hook_command_exists() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected