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:
viyatb-oai
2026-04-07 14:48:27 -07:00
parent ccea133400
commit fa5270abef
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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 {