Repository navigation
fix(test): use forward slash in MockFileSystem.Walk path matching - #611
Open
dipak0000812 wants to merge 1 commit into
Open
dipak0000812 wants to merge 1 commit into
dipak0000812 wants to merge 1 commit into
Conversation
MockFileSystem fixtures use forward-slash paths regardless of the host OS. Matching child paths using filepath.Separator caused MockFileSystem.Walk to fail prefix checks on Windows where separator is '\', causing 7 subtests in TestImportDirectory and TestFindSpecificationFilesWithFS to fail. Match on "/" instead of filepath.Separator so mock traversal is portable across operating systems. Closes microcks#601 Signed-off-by: Dipak Dhangar <[email protected]>
dipak0000812
requested review from
Caesarsage,
Harsh4902,
lbroudoux and
yada
as code owners
October 31, 2026 16:44
This branch was previously deployed
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.
Description
Fixes #601
MockFileSystem.Walkincmd/importDir_test.gousedfilepath.Separatorwhen matching child fixture paths against the requested root.The mock filesystem fixtures use forward-slash paths regardless of the host operating system. On Windows,
filepath.Separatorresolves to\, causing the prefix check to fail for paths such as/test/openapi.yaml.As suggested by @Caesarsage in #601, this changes the prefix check to use
/, matching the path convention used by the mock filesystem.The change is limited to test infrastructure and does not modify production import behavior.
Verification
go test ./cmd/...go vet ./cmd/...git diff --checkDisclosure: Minimal AI assistance was used for issue investigation and PR preparation. The contributor reviewed the implementation and verified the changes locally.