Skip to content

Commit 4c1b67f

Browse files
phase3devclaude
andcommitted
test: assert bash/node launcher parity on bundle bytes and injected args
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6c90856 commit 4c1b67f

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

‎tests/test_reconcile.py‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,5 +189,47 @@ def _run(self, td, home, args=None, env_extra=None):
189189
return run(["node", str(LAUNCHER_WIN), *(args or [])], env=env)
190190

191191

192+
@unittest.skipIf(os.name == "nt", "needs both bash and node on PATH")
193+
class ParityTests(unittest.TestCase):
194+
def test_bash_and_node_produce_identical_bundle_and_args(self):
195+
results = {}
196+
for kind in ("bash", "node"):
197+
with tempfile.TemporaryDirectory() as td:
198+
home = pathlib.Path(td)
199+
idx = make_extension(home, f"before {OLD} after")
200+
if kind == "bash":
201+
fake, capture = make_fake_claude(td)
202+
env = {
203+
"HOME": str(home),
204+
"CLAUDE_REAL_BIN": str(fake),
205+
"CAPTURE_ARGS": str(capture),
206+
}
207+
res = run([str(LAUNCHER_BASH), "--max-thinking-tokens=200"], env=env)
208+
else:
209+
cli, capture = make_fake_node_cli(td)
210+
shim = make_fake_cmd_shim(td, cli)
211+
env = {
212+
"HOME": str(home),
213+
"USERPROFILE": str(home),
214+
"CLAUDE_REAL_BIN": str(shim),
215+
"CAPTURE_ARGS": str(capture),
216+
}
217+
res = run(
218+
["node", str(LAUNCHER_WIN), "--max-thinking-tokens=200"], env=env
219+
)
220+
self.assertEqual(res.returncode, 0, res.stderr)
221+
results[kind] = (
222+
idx.read_text(encoding="utf-8"),
223+
captured_args(capture),
224+
)
225+
self.assertEqual(results["bash"][0], results["node"][0])
226+
self.assertEqual(results["bash"][1], results["node"][1])
227+
self.assertEqual(results["bash"][0], f"before {MARKED} after")
228+
self.assertEqual(
229+
results["bash"][1],
230+
["--max-thinking-tokens=200", "--thinking-display", "summarized"],
231+
)
232+
233+
192234
if __name__ == "__main__":
193235
unittest.main()

0 commit comments

Comments
 (0)