mirror of
https://github.com/openai/codex.git
synced 2026-11-16 22:00:36 +00:00
fix: make hook precedence tests portable
Co-authored-by: Codex noreply@openai.com
This commit is contained in:
co-authored by
Codex noreply@openai.com
parent
6ea0cae246
commit
4982c9751f
@@ -397,15 +397,15 @@ mod tests {
|
||||
(
|
||||
"cmd.exe".to_string(),
|
||||
vec!["/D".to_string(), "/C".to_string()],
|
||||
r#"echo {^"continue^":false,^"stopReason^":^"pause^",^"hookSpecificOutput^":{^"hookEventName^":^"SessionStart^",^"additionalContext^":^"trusted context^"}}"#.to_string(),
|
||||
"type nul > project-ran && echo project context".to_string(),
|
||||
r#"more > nul && echo {^"continue^":false,^"stopReason^":^"pause^",^"hookSpecificOutput^":{^"hookEventName^":^"SessionStart^",^"additionalContext^":^"trusted context^"}}"#.to_string(),
|
||||
"more > nul && type nul > project-ran && echo project context".to_string(),
|
||||
)
|
||||
} else {
|
||||
(
|
||||
"/bin/sh".to_string(),
|
||||
vec!["-c".to_string()],
|
||||
"printf '%s' '{\"continue\":false,\"stopReason\":\"pause\",\"hookSpecificOutput\":{\"hookEventName\":\"SessionStart\",\"additionalContext\":\"trusted context\"}}'".to_string(),
|
||||
"touch project-ran && printf 'project context'".to_string(),
|
||||
"cat >/dev/null; printf '%s' '{\"continue\":false,\"stopReason\":\"pause\",\"hookSpecificOutput\":{\"hookEventName\":\"SessionStart\",\"additionalContext\":\"trusted context\"}}'".to_string(),
|
||||
"cat >/dev/null; touch project-ran && printf 'project context'".to_string(),
|
||||
)
|
||||
};
|
||||
let handlers = vec![
|
||||
|
||||
@@ -454,15 +454,15 @@ mod tests {
|
||||
(
|
||||
"cmd.exe".to_string(),
|
||||
vec!["/D".to_string(), "/C".to_string()],
|
||||
r#"echo {^"decision^":^"block^",^"reason^":^"slow down^",^"hookSpecificOutput^":{^"hookEventName^":^"UserPromptSubmit^",^"additionalContext^":^"trusted context^"}}"#.to_string(),
|
||||
"type nul > project-ran && echo project context".to_string(),
|
||||
r#"more > nul && echo {^"decision^":^"block^",^"reason^":^"slow down^",^"hookSpecificOutput^":{^"hookEventName^":^"UserPromptSubmit^",^"additionalContext^":^"trusted context^"}}"#.to_string(),
|
||||
"more > nul && type nul > project-ran && echo project context".to_string(),
|
||||
)
|
||||
} else {
|
||||
(
|
||||
"/bin/sh".to_string(),
|
||||
vec!["-c".to_string()],
|
||||
"printf '%s' '{\"decision\":\"block\",\"reason\":\"slow down\",\"hookSpecificOutput\":{\"hookEventName\":\"UserPromptSubmit\",\"additionalContext\":\"trusted context\"}}'".to_string(),
|
||||
"touch project-ran && printf 'project context'".to_string(),
|
||||
"cat >/dev/null; printf '%s' '{\"decision\":\"block\",\"reason\":\"slow down\",\"hookSpecificOutput\":{\"hookEventName\":\"UserPromptSubmit\",\"additionalContext\":\"trusted context\"}}'".to_string(),
|
||||
"cat >/dev/null; touch project-ran && printf 'project context'".to_string(),
|
||||
)
|
||||
};
|
||||
let handlers = vec![
|
||||
|
||||
Reference in New Issue
Block a user