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>
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user