Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ def write_script_launcher(directory: Path, name: str, body: str) -> Path:
sidecar.write_text(body, encoding="utf-8")
if sys.platform == "win32":
launcher = directory / f"{name}.cmd"
launcher.write_text(f'@"{sys.executable}" "{sidecar}" %*\r\n', encoding="utf-8")
# `\n`, not `\r\n`: write_text translates it to the CRLF cmd wants, so an
# explicit `\r` would land on disk doubled (`\r\r\n`).
launcher.write_text(f'@"{sys.executable}" "{sidecar}" %*\n', encoding="utf-8")
else:
launcher = directory / name
launcher.write_text(
Expand Down
17 changes: 14 additions & 3 deletions tests/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -4739,9 +4739,20 @@ def test_fix_phase_session_env_fault_escalates(project):
burning the remaining dev budget on repair sessions that never ran."""
write_sprint(project, {"1-1-a": "ready-for-dev"})
marker = project.project / "fixed.marker"
script = project.project / "check.sh"
script.write_text("#!/bin/sh\nexit 0\n", encoding="utf-8")
script.chmod(0o755)
# per-OS script (#292): verify commands run through the host shell, and cmd hands
# a `.sh` path to ShellExecute — with no `.sh` association that pops the interactive
# file picker mid-run; with one it launches the associated app and returns success
# without running the script. The subject here is session transport, not POSIX
# shells, so build the script for the host rather than skipping the test on win32.
if sys.platform == "win32":
script = project.project / "check.cmd"
# `exit /b`: a bare `exit` in a batch file kills the invoking cmd, not just the
# script. `\n` alone — write_text already translates it to the CRLF cmd wants.
script.write_text("@exit /b 0\n", encoding="utf-8")
else:
script = project.project / "check.sh"
script.write_text("#!/bin/sh\nexit 0\n", encoding="utf-8")
script.chmod(0o755)

def dev_with_marker(spec):
marker.write_text("ok\n")
Expand Down