Skip to content

Conversation

@watany-dev
Copy link
Owner

Add comprehensive tests for ValidateWorkingDirectory and
ValidatePathWithSymlinkResolution to cover all error branches:

  • Introduce testable function variables (filepathRel, filepathEvalSymlinks,
    osLstat) to enable mock-based testing of error paths
  • Add mock tests for filepath.Rel errors in ValidateWorkingDirectory
  • Add mock tests for os.Lstat errors in ValidatePathWithSymlinkResolution
  • Add mock tests for EvalSymlinks errors on both fullPath and basePath
  • Add mock tests for filepath.Rel errors in symlink resolution
  • Add tests for ValidateWorkingDirectory error propagation in
    ValidatePathWithSymlinkResolution

Coverage improved from 89.1% to 100%:

  • ValidateWorkingDirectory: 91.7% -> 100%
  • ValidatePathWithSymlinkResolution: 80.0% -> 100%

Add comprehensive tests for ValidateWorkingDirectory and
ValidatePathWithSymlinkResolution to cover all error branches:

- Introduce testable function variables (filepathRel, filepathEvalSymlinks,
  osLstat) to enable mock-based testing of error paths
- Add mock tests for filepath.Rel errors in ValidateWorkingDirectory
- Add mock tests for os.Lstat errors in ValidatePathWithSymlinkResolution
- Add mock tests for EvalSymlinks errors on both fullPath and basePath
- Add mock tests for filepath.Rel errors in symlink resolution
- Add tests for ValidateWorkingDirectory error propagation in
  ValidatePathWithSymlinkResolution

Coverage improved from 89.1% to 100%:
- ValidateWorkingDirectory: 91.7% -> 100%
- ValidatePathWithSymlinkResolution: 80.0% -> 100%
@watany-dev watany-dev merged commit 3c3ff61 into main Jan 9, 2026
4 checks passed
@watany-dev watany-dev deleted the claude/improve-path-test-coverage-DoKEW branch January 9, 2026 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants