From 75ac22781dbdd4e421001a6dbc6a3eea08dabb1f Mon Sep 17 00:00:00 2001 From: Martin Vogel Date: Thu, 6 Aug 2026 02:56:55 +0200 Subject: [PATCH] test(contract): assert the sync HEAD-comparison property, not one spelling The Windows bundle contract pinned the literal remote_head="$(vm clangarm64 "cd /c/cbm && git rev-parse --verify HEAD")" so parametrising the checkout path for per-run isolation failed it, even though the property it guards - capture the remote HEAD into a local variable and compare it HERE, never nesting quotes through cmd.exe - still holds. Match the shape with the path as \S+ instead. Verified the contract still binds: replacing the capture with a constant fails it for the right reason, restoring it passes. Signed-off-by: Martin Vogel --- tests/test_windows_bundle_contract.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_windows_bundle_contract.sh b/tests/test_windows_bundle_contract.sh index e3382206d..50382ee6d 100644 --- a/tests/test_windows_bundle_contract.sh +++ b/tests/test_windows_bundle_contract.sh @@ -537,8 +537,14 @@ require( ) require( sync_case is not None - and 'remote_head="$(vm clangarm64 "cd /c/cbm && git rev-parse --verify HEAD")"' - in sync_case.group("body") + # Assert the PROPERTY, not one spelling of it: capture the remote HEAD into + # a local variable and compare it here. The checkout path became a variable + # (per-run isolation), so pinning the literal `/c/cbm` was asserting the + # implementation rather than the contract it exists to protect. + and re.search( + r'remote_head="\$\(vm clangarm64 "cd \S+ && git rev-parse --verify HEAD"\)"', + sync_case.group("body"), + ) and 'test \\"\\$(git rev-parse --verify HEAD)\\"' not in sync_case.group("body"), "win.sh sync must compare the remote HEAD locally instead of nesting shell quotes through " "cmd.exe",