Skip to content

Add automated Windows path normalization tests for spec.match_file() #10

@chigwell

Description

@chigwell

User Story
As a maintainer,
I want automated tests for Windows path normalization in spec.match_file()
so that cross-platform behavior is verified and regressions are prevented.

Background
The scan_directory function uses pathspec for OS-agnostic path matching, but the current test suite lacks validation for Windows-style paths (e.g., backslashes). This creates risks:

  • Path normalization logic in scanner.py (lines 9–14) may behave unexpectedly on Windows
  • Undetected mismatches between Unix-style ignore patterns and Windows paths
  • Silent failures when deploying the tool in mixed-OS environments

Acceptance Criteria

  • Create tests/unit/test_path_normalization.py with Windows path test cases
  • Test both normalized (POSIX-style) and raw Windows paths in spec.match_file():
    # Example test case
    assert spec.match_file("C:\\Users\\Project\\tmp\\file.log") == True  # For pattern "tmp/*"
  • Verify path normalization handles:
    • Backslashes in input paths
    • Mixed casing (Windows case-insensitivity)
    • Network paths (e.g., \\server\share\file.txt)
  • Add Windows runner to CI/CD (GitHub Actions or similar)
  • Update README.md Testing section to mention Windows compatibility verification

Validation

  • Run test suite on Windows machine and confirm 100% pass rate
  • Confirm CI pipeline executes Windows-specific tests
  • Check debug logs during tests for correct path normalization output

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions