Skip to content

fix: Windows test failures for init and path validation - #99

Merged
zaynelt merged 1 commit into
developfrom
fix/issues-87-88-windows-test-failures
Aug 1, 2026
Merged

fix: Windows test failures for init and path validation#99
zaynelt merged 1 commit into
developfrom
fix/issues-87-88-windows-test-failures

Conversation

@cmworkato

Copy link
Copy Markdown
Collaborator

Summary

Fixes two Windows-specific test failures discovered while testing issue #85.

Issue #87: TestInit tests fail on Windows — missing dev profile

setupTestHome and setupIsolatedHome only set HOME, but on Windows os.UserHomeDir() reads USERPROFILE. The profile fixtures were invisible to the code under test.

Fix: Set both HOME and USERPROFILE in both test helpers.

Issue #88: validateLocalPath doesn't reject Windows absolute paths

filepath.IsAbs("/tmp/evil") returns false on Windows (no volume letter). Paths like C:\foo were correctly caught, but rooted paths like /tmp/evil or \foo slipped through.

Fix: Also check filepath.VolumeName() and leading / or \ characters. Added test cases for Windows drive-letter paths and rooted backslash paths.

Testing

Full test suite passes on Windows (go test ./... -count=1) — all packages green.

Closes #87, closes #88

…sue #87: TestInit* and resolve tests fail on Windows because setupTestHome/setupIsolatedHome only set HOME env var. On Windows, os.UserHomeDir() reads USERPROFILE instead. Fix: set both HOME and USERPROFILE in test helpers. Issue #88: ValidateLocalPath does not reject Windows absolute paths. On Windows, filepath.IsAbs returns false for '/tmp/evil' (no volume letter). Fix: also check filepath.VolumeName and leading slash/backslash to catch all forms of non-relative paths. Added Windows-specific test cases (drive letter, rooted backslash). Closes #87, closes #88
@zaynelt
zaynelt self-requested a review July 30, 2026 21:40

@zaynelt zaynelt left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Good catches & more proof of the need for regular Windows testing.

@zaynelt
zaynelt merged commit 44d2941 into develop Aug 1, 2026
7 checks passed
@zaynelt
zaynelt deleted the fix/issues-87-88-windows-test-failures branch August 1, 2026 18:24
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.

Bug: validateLocalPath does not reject Windows absolute paths Bug: TestInit tests fail on Windows - missing dev profile in test fixtures

2 participants