()
| 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() { |
nothing calls this directly
no outgoing calls
no test coverage detected