Make the pipe-buffer test's command valid on cmd

CI (Test — Windows x86_64 on PR #71) fails only this test: it writes the loop in sh syntax, but spawn_shell runs commands through cmd /C on Windows, and cmd's parser rejects the sh for-loop — "i was unexpected at this time" — so the command exits 1 before it produces any output. The drain fix being tested is fine; the test just never reaches it. Give the Windows target its own command with cmd's for /L loop, the same pattern every other command test in this module already uses. echo is a cmd builtin, so 2000 iterations stay fast, and @echo suppresses the per-iteration prompt echo so the captured output still overflows the pipe buffer. Co-Authored-By: siGit Code <noreply@sigit.si>

paydii committed Sep 5, 2026 at 09:54 UTC cc9dddb499dd7edb895c68ae2dd0f2787d41044b
1 file changed +7
src/tools.rs
+7
@@ -3166,7 +3166,14 @@ mod tests {
3166 // COMMAND_OUTPUT_LIMIT, so the result is truncated; the point of the
3167 // test is that the command finishes at all.
3168 let line = "x".repeat(199);
3169 + // ~400 KB, well past any platform's pipe buffer. It also crosses
3170 + // COMMAND_OUTPUT_LIMIT, so the result is truncated; the point of the
3171 + // test is that the command finishes at all.
3172 + #[cfg(unix)]
3173 let command = format!("for i in $(seq 1 2000); do echo {line}; done");
3174 + // cmd has no seq; echo is a builtin so 2000 iterations stay fast.
3175 + #[cfg(windows)]
3176 + let command = format!("for /L %i in (1,1,2000) do @echo {line}");
3177 let args = json!({"command": command, "cwd": dir.to_str().unwrap()}).to_string();
3178
3179 let started = std::time::Instant::now();