opencloud icon indicating copy to clipboard operation
opencloud copied to clipboard

tests: make path expectations OS-agnostic (Windows-compatible)

Open kjm99d opened this issue 1 month ago • 0 comments

Scope: tests only
Files:

  • pkg/x/path/filepathx/path_test.go
  • services/thumbnails/pkg/thumbnail/storage/filesystem_test.go
  • services/web/pkg/apps/apps_test.go
  • services/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.MapFS expects keys with forward slashes (/).
  • Several tests implicitly assumed Unix separators, leading to false negatives on Windows.
  • Applying filepath.FromSlash to expected values and using OS-aware MapFS keys removes these platform-specific failures without altering production behavior.

What changed

  • Normalize expected path strings with filepath.FromSlash(...).
  • Use forward-slash MapFS keys 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.

kjm99d avatar Nov 11 '25 13:11 kjm99d