opencloud
opencloud copied to clipboard
tests: make path expectations OS-agnostic (Windows-compatible)
Scope: tests only
Files:
pkg/x/path/filepathx/path_test.goservices/thumbnails/pkg/thumbnail/storage/filesystem_test.goservices/web/pkg/apps/apps_test.goservices/storage-users/pkg/command/trash_bin_test.go
Summary
This PR makes unit tests OS-agnostic by normalizing path expectations and adjusting fstest.MapFS usage so that tests pass consistently on both Windows and Unix.
Rationale
fstest.MapFSexpects keys with forward slashes (/).- Several tests implicitly assumed Unix separators, leading to false negatives on Windows.
- Applying
filepath.FromSlashto expected values and using OS-awareMapFSkeys removes these platform-specific failures without altering production behavior.
What changed
- Normalize expected path strings with
filepath.FromSlash(...). - Use forward-slash
MapFSkeys while keeping comparisons OS-aware. - No production or vendor code changes.
How to test locally
go test ./pkg/x/path/filepathx -run TestJailJoin -v
go test ./services/web/pkg/apps -run TestBuild -v
Notes
- Tests only. Production/vendor updates live on a separate branch and will be proposed later.