mirror of
https://github.com/openai/codex.git
synced 2026-10-25 18:28:38 +00:00
test(hooks): preserve JSON quotes in windows stop fixtures
cmd.exe removes unescaped JSON quotes before echoing. Caret-escape the quotes so the observer hook stop/block tests feed valid JSON to the hook output parser on Windows.\n\nCo-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -394,7 +394,7 @@ mod tests {
|
||||
(
|
||||
"cmd.exe".to_string(),
|
||||
vec!["/D".to_string(), "/C".to_string()],
|
||||
"echo {\"continue\":false,\"stopReason\":\"pause\",\"hookSpecificOutput\":{\"hookEventName\":\"SessionStart\",\"additionalContext\":\"trusted context\"}}".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(),
|
||||
)
|
||||
} else {
|
||||
|
||||
@@ -453,7 +453,7 @@ mod tests {
|
||||
(
|
||||
"cmd.exe".to_string(),
|
||||
vec!["/D".to_string(), "/C".to_string()],
|
||||
"echo {\"decision\":\"block\",\"reason\":\"slow down\",\"hookSpecificOutput\":{\"hookEventName\":\"UserPromptSubmit\",\"additionalContext\":\"trusted context\"}}".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(),
|
||||
)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user