Skip to content

Commit 75ac227

Browse files
committed
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 <martin.vogel.tech@gmail.com>
1 parent ba57243 commit 75ac227

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎tests/test_windows_bundle_contract.sh‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,14 @@ require(
537537
)
538538
require(
539539
sync_case is not None
540-
and 'remote_head="$(vm clangarm64 "cd /c/cbm && git rev-parse --verify HEAD")"'
541-
in sync_case.group("body")
540+
# Assert the PROPERTY, not one spelling of it: capture the remote HEAD into
541+
# a local variable and compare it here. The checkout path became a variable
542+
# (per-run isolation), so pinning the literal `/c/cbm` was asserting the
543+
# implementation rather than the contract it exists to protect.
544+
and re.search(
545+
r'remote_head="\$\(vm clangarm64 "cd \S+ && git rev-parse --verify HEAD"\)"',
546+
sync_case.group("body"),
547+
)
542548
and 'test \\"\\$(git rev-parse --verify HEAD)\\"' not in sync_case.group("body"),
543549
"win.sh sync must compare the remote HEAD locally instead of nesting shell quotes through "
544550
"cmd.exe",

0 commit comments

Comments
 (0)