fix: Windows test failures for init and path validation - #99
Merged
Conversation
…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
self-requested a review
July 30, 2026 21:40
zaynelt
approved these changes
Jul 30, 2026
zaynelt
left a comment
Collaborator
There was a problem hiding this comment.
Looks good to me. Good catches & more proof of the need for regular Windows testing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two Windows-specific test failures discovered while testing issue #85.
Issue #87: TestInit tests fail on Windows — missing dev profile
setupTestHomeandsetupIsolatedHomeonly setHOME, but on Windowsos.UserHomeDir()readsUSERPROFILE. The profile fixtures were invisible to the code under test.Fix: Set both
HOMEandUSERPROFILEin both test helpers.Issue #88: validateLocalPath doesn't reject Windows absolute paths
filepath.IsAbs("/tmp/evil")returnsfalseon Windows (no volume letter). Paths likeC:\foowere correctly caught, but rooted paths like/tmp/evilor\fooslipped 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