Skip to content

Commit e602275

Browse files
fsilvaortizclaude
andcommitted
test: add static guard for PowerShell number collision validation
Addresses Copilot review comment — verifies the PowerShell script contains the collision detection logic (manualNumPadded, git fetch, warning message, AllowExistingBranch bypass). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d66aa26 commit e602275

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/test_timestamp_branches.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,3 +413,15 @@ def test_powershell_supports_allow_existing_branch_flag(self):
413413
assert "-AllowExistingBranch" in contents
414414
# Ensure the flag is referenced in script logic, not just declared
415415
assert "AllowExistingBranch" in contents.replace("-AllowExistingBranch", "")
416+
417+
def test_powershell_has_number_collision_validation(self):
418+
"""Static guard: PS script validates manual -Number against existing branches/specs."""
419+
contents = CREATE_FEATURE_PS.read_text(encoding="utf-8")
420+
# Must check specs directory for collision
421+
assert "manualNumPadded" in contents
422+
# Must check git branches for collision
423+
assert "git fetch --all --prune" in contents
424+
# Must warn and auto-detect on conflict
425+
assert "conflicts with existing branch/spec" in contents
426+
# Must skip validation when -AllowExistingBranch is set
427+
assert "elseif (-not $AllowExistingBranch)" in contents

0 commit comments

Comments
 (0)