Skip to content

#1267: three relink path-format test failures on Windows - #1272

Closed
vangel76 wants to merge 1 commit into
storytold:mainfrom
vangel76:fix-relink-windows-tests
Closed

vangel76 wants to merge 1 commit into
storytold:mainfrom
vangel76:fix-relink-windows-tests

Conversation

@vangel76

Copy link
Copy Markdown
Contributor

Fixes #1267.

What this does

Three relink tests (from #1106) fail on Windows on main. The app is fine; the tests compare path strings. On Windows the relink code writes the paths it derives with /, while the tests build their expected paths with PathBuf::join, which mixes \ and /. Both spell the same file, and the relinked paths work on Windows. Test code only, no product change. Each failure was reproduced on unmodified main first.

  • effectcraft-engine relinking_one_file_finds_the_others_that_moved_with_it: compares Path values instead of strings.
  • effectcraft-engine footage_moved_with_its_project_is_found_on_open: looks for the relinked file with Path equality instead of contains on a string.
  • effectcraft-host replacing_a_missing_file_relinks_the_others_that_moved_with_it: uses Path::starts_with instead of a string prefix check.

Path comparison is by components, so the tests behave the same on macOS and Linux.

Checks

Windows 11, Rust 1.99, on top of main at 549e9d8.

  • All three tests fail on unmodified main and pass with this change.
  • cargo fmt --all --check passes; cargo clippy --workspace --all-targets --release -- -D warnings passes.
  • cargo test --release -p effectcraft-engine --lib (612 passed) and -p effectcraft-host --test relink pass.
  • Not run on this branch: the full cargo test --workspace and cargo xtask layers/assets/wasm (test-only change in two crates; CI covers the rest).

Problem: on Windows three relink tests failed on main although the app is fine. The relink
code writes the paths it derives with a forward slash, the tests built their expected paths
with PathBuf::join, which mixes both separators, and compared them as strings. Both
spellings name the same file on Windows.

Fix: the tests compare Path values (component-wise) instead of strings. Test code only, no
product change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@bflatastic

Copy link
Copy Markdown
Member

Thank you @vangel76, and sorry for the overlap: you found these first (#1267). I landed #1639 before seeing this PR. It fixes the same three tests, and while in there it fixes the cause too: project_dir rebuilt Windows paths with / and dropped a UNC share's \, so a project opened from a network share never found its moved footage. The tests now use native paths and check that the backslashes are kept. Closing this one as superseded; please reopen if you see something #1639 misses.

@bflatastic bflatastic closed this Oct 16, 2026
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.

Tests: three relink path-format failures on Windows (engine, host)

2 participants