WIP: test(game): four game-side checks that fail only on Windows pass there: whole paths, and a file system that folds case #2845

Closed
llun wants to merge 1 commit from fix/mod-api-win-game-test-fixtures into mod-api
Member

Summary

For #2822 (into mod-api). Four checks on the game side fail only on Windows. In each case the code is right and the test's fixture assumes Unix:

  • longshot-game mod_tests::tests::a_folder_of_mods_tests_each_of_its_folders: the plan joins a suite's folder with Path::join (/t/suite\hud on Windows), and the test wrote the expected folders out (/t/suite/hud). The expected value is now joined the same way.
  • longshot-game runtime::tests::a_separate_mod_moves_the_saves_into_its_profile_and_records_it and a_mods_profile_sits_inside_the_launchers_save_folder: they rooted the user and launcher folders at /u and /profiles/two. Windows takes those as rooted but not whole, so the profile's folder, made whole by saves_in with std::path::absolute, took the current drive (C:\u\…) and the comparisons failed. They start from a whole path on each system now (whole(): as it is on Unix, under C:\ on Windows).
  • modtool emulators::tests::eden_and_ryujinx_mods_are_found_with_their_switches: it writes Eden's title-id folder in lower case and in capitals. That is two folders on Linux, but one on Windows and macOS, whose file systems fold case, and there that folder's mods come by name. The test now reads which one the file system gave, expects that order, and finds Speed and Grass by name, not by place.

No code the game runs changes. Every assertion stays, among them a_mods_profile_sits_inside_the_launchers_save_folder's check that a mod's profile sits inside the launcher's save/ subtree, the one the sandbox grants.

To see it on mod-api: on Windows, cargo test -p longshot-game --lib and cargo test -p modtool --lib emulators (--target x86_64-pc-windows-gnullvm with llvm-mingw).

Testing

Tested: the four checks, on Windows 11 (--target x86_64-pc-windows-gnullvm with llvm-mingw) and on Linux (WSL Ubuntu 24.04). The change is test code only, so there is nothing new for the game to run. Every game run in this PR's series used builds that included this code unchanged.

Checks:

  • On mod-api @ c5e5b676, Windows: longshot-game --lib 165 pass, these three fail. modtool fails eden_and_ryujinx_mods_are_found_with_their_switches (left: [Grass, Speed, Hud], right: [Speed, Grass, Hud]).
  • Here, Windows: longshot-game --lib 168 pass, 0 fail. modtool's eden_and_ryujinx_mods_are_found_with_their_switches passes.
  • Here, Linux (WSL Ubuntu 24.04, cargo test): mod_tests::…a_folder_of_mods_tests_each_of_its_folders and the runtime tests (5) pass, and so does modtool's eden_and_ryujinx_mods_are_found_with_their_switches (two folders there: the capitals-first order).
  • The sandbox's check still bites: with saves_in changed to put the mod's profile outside save/ (b.join(folder), undone after), a_mods_profile_sits_inside_the_launchers_save_folder fails on Windows (left: C:\profiles\two\a~rando, right: …\save\.profiles\a~rando).
  • cargo fmt --check, cargo clippy -p longshot-game -p modtool --all-targets --no-deps -- -D warnings (Windows target) and mise run lint pass.

Still to test:

  • macOS: cargo test -p modtool --lib emulators (its file system folds case, as Windows' does)

Measurements

Verdict: fixed. The four checks pass on Windows and still pass on Linux.

Baseline: mod-api (#2822's head), the branch this PR goes into. Nothing to time: test code only.

Before: mod-api @ c5e5b676 After: this PR @ 7332362d9
cargo test -p longshot-game --lib, Windows 165 pass, 3 fail 168 pass
modtool eden_and_ryujinx_mods_are_found_with_their_switches, Windows FAIL (the order) pass
The same, Linux pass pass

Risks

The sandbox: not touched; no code the game runs changes. The test that checks a mod's profile sits inside the launcher's granted save/ subtree keeps that assertion, and still fails when the profile is put outside it (above).

On a file system that folds case, the emulators test no longer checks that a title id in capitals sorts first: there it is the same folder. Linux, where it is two folders, still checks it. A revert is enough.

Checklist

Ready for review

  • One topic, on current mod-api (#2822's head); the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says. (Test code only: nothing for the game to run.)
  • mise run test passes (any failure that also fails on main is named). (The checks this change reaches pass, as above. mod-api's whole suite has failures on Windows that this PR doesn't change: #2826 fixes six of them.)
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here. (Not a fix of the game: the four tests themselves fail on mod-api on Windows and pass here.)
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary For [#2822](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2822) (into `mod-api`). Four checks on the game side fail only on Windows. In each case the code is right and the test's fixture assumes Unix: - `longshot-game` `mod_tests::tests::a_folder_of_mods_tests_each_of_its_folders`: the plan joins a suite's folder with `Path::join` (`/t/suite\hud` on Windows), and the test wrote the expected folders out (`/t/suite/hud`). The expected value is now joined the same way. - `longshot-game` `runtime::tests::a_separate_mod_moves_the_saves_into_its_profile_and_records_it` and `a_mods_profile_sits_inside_the_launchers_save_folder`: they rooted the user and launcher folders at `/u` and `/profiles/two`. Windows takes those as rooted but not whole, so the profile's folder, made whole by `saves_in` with `std::path::absolute`, took the current drive (`C:\u\…`) and the comparisons failed. They start from a whole path on each system now (`whole()`: as it is on Unix, under `C:\` on Windows). - `modtool` `emulators::tests::eden_and_ryujinx_mods_are_found_with_their_switches`: it writes Eden's title-id folder in lower case and in capitals. That is two folders on Linux, but one on Windows and macOS, whose file systems fold case, and there that folder's mods come by name. The test now reads which one the file system gave, expects that order, and finds Speed and Grass by name, not by place. No code the game runs changes. Every assertion stays, among them `a_mods_profile_sits_inside_the_launchers_save_folder`'s check that a mod's profile sits inside the launcher's `save/` subtree, the one the sandbox grants. **To see it on `mod-api`:** on Windows, `cargo test -p longshot-game --lib` and `cargo test -p modtool --lib emulators` (`--target x86_64-pc-windows-gnullvm` with llvm-mingw). ## Testing **Tested:** the four checks, on Windows 11 (`--target x86_64-pc-windows-gnullvm` with llvm-mingw) and on Linux (WSL Ubuntu 24.04). The change is test code only, so there is nothing new for the game to run. Every game run in this PR's series used builds that included this code unchanged. Checks: - On `mod-api` @ c5e5b676, Windows: `longshot-game --lib` 165 pass, these three fail. `modtool` fails `eden_and_ryujinx_mods_are_found_with_their_switches` (`left: [Grass, Speed, Hud]`, `right: [Speed, Grass, Hud]`). - Here, Windows: `longshot-game --lib` 168 pass, 0 fail. `modtool`'s `eden_and_ryujinx_mods_are_found_with_their_switches` passes. - Here, Linux (WSL Ubuntu 24.04, `cargo test`): `mod_tests::…a_folder_of_mods_tests_each_of_its_folders` and the `runtime` tests (5) pass, and so does `modtool`'s `eden_and_ryujinx_mods_are_found_with_their_switches` (two folders there: the capitals-first order). - The sandbox's check still bites: with `saves_in` changed to put the mod's profile outside `save/` (`b.join(folder)`, undone after), `a_mods_profile_sits_inside_the_launchers_save_folder` fails on Windows (`left: C:\profiles\two\a~rando`, `right: …\save\.profiles\a~rando`). - `cargo fmt --check`, `cargo clippy -p longshot-game -p modtool --all-targets --no-deps -- -D warnings` (Windows target) and `mise run lint` pass. **Still to test:** - macOS: `cargo test -p modtool --lib emulators` (its file system folds case, as Windows' does) ## Measurements **Verdict:** fixed. The four checks pass on Windows and still pass on Linux. Baseline: `mod-api` (#2822's head), the branch this PR goes into. Nothing to time: test code only. | | Before: mod-api @ c5e5b676 | After: this PR @ 7332362d9 | |---|---|---| | `cargo test -p longshot-game --lib`, Windows | 165 pass, 3 fail | 168 pass | | `modtool` `eden_and_ryujinx_mods_are_found_with_their_switches`, Windows | FAIL (the order) | pass | | The same, Linux | pass | pass | ## Risks **The sandbox:** not touched; no code the game runs changes. The test that checks a mod's profile sits inside the launcher's granted `save/` subtree keeps that assertion, and still fails when the profile is put outside it (above). On a file system that folds case, the emulators test no longer checks that a title id in capitals sorts first: there it is the same folder. Linux, where it is two folders, still checks it. A revert is enough. ## Checklist ### Ready for review - [x] One topic, on current `mod-api` (#2822's head); the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. (Test code only: nothing for the game to run.) - [ ] `mise run test` passes (any failure that also fails on `main` is named). (The checks this change reaches pass, as above. `mod-api`'s whole suite has failures on Windows that this PR doesn't change: [#2826](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2826) fixes six of them.) - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [ ] A fix: a game-free test that fails on `main` and passes here. (Not a fix of the game: the four tests themselves fail on `mod-api` on Windows and pass here.) - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
test(game): four game-side checks that fail only on Windows pass there: whole paths, and a file system that folds case
All checks were successful
PR description / Title and description (pull_request_target) Successful in 7s
18c277e8ba
longshot-game's mod-tests plan joins a suite's folder with Path::join, so its expected LONGSHOT_DEV_MODS is the suite's
folder joined too, not a written "/t/suite/hud". The saves tests rooted the user and launcher folders at "/u" and
"/profiles/two", which Windows takes as rooted but not whole: the profile's folder, made whole with
std::path::absolute, took the current drive, and the comparisons failed on "C:". They start from a whole path on each
system now (whole()); every assertion stays, the one that the mod's profile sits inside the launcher's granted save/
subtree too. modtool's emulators test wrote Eden's title-id folder in lower and in capitals, two folders on Linux, one
on Windows and macOS, whose file systems fold case: there the one folder's mods come by name, and the test reads the
order the file system gives and finds Speed and Grass by name.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
llun force-pushed fix/mod-api-win-game-test-fixtures from 18c277e8ba
All checks were successful
PR description / Title and description (pull_request_target) Successful in 7s
to 266fea0a6b
All checks were successful
PR description / Title and description (pull_request_target) Successful in 12s
2026-11-30 01:33:00 +00:00
Compare
Author
Member

Rebased onto mod-api @ 537c2816 (#2848, game-free checks' fixtures only), now 266fea0a: the same diff (same git patch-id), no conflict. #2848 touches none of this PR's files, so its checks still hold.

Rebased onto `mod-api` @ 537c2816 ([#2848](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2848), game-free checks' fixtures only), now 266fea0a: the same diff (same `git patch-id`), no conflict. #2848 touches none of this PR's files, so its checks still hold.
llun force-pushed fix/mod-api-win-game-test-fixtures from 266fea0a6b
All checks were successful
PR description / Title and description (pull_request_target) Successful in 12s
to 7221182d7c
All checks were successful
PR description / Title and description (pull_request_target) Successful in 12s
2026-11-30 02:14:34 +00:00
Compare
Author
Member

Rebased onto mod-api aea64d3a (#2745 nav.closest, one new commit): 266fea0a -> 7221182d, the same diff (git patch-id unchanged), so the checks and runs above still hold; none of this PR's files changed on mod-api. The description's head hash is updated.

Rebased onto mod-api aea64d3a (#2745 nav.closest, one new commit): 266fea0a -> 7221182d, the same diff (git patch-id unchanged), so the checks and runs above still hold; none of this PR's files changed on mod-api. The description's head hash is updated.
llun force-pushed fix/mod-api-win-game-test-fixtures from 7221182d7c
All checks were successful
PR description / Title and description (pull_request_target) Successful in 12s
to d037060296
All checks were successful
PR description / Title and description (pull_request_target) Successful in 10s
2026-11-30 03:14:34 +00:00
Compare
Author
Member

Rebased onto the new mod-api cb37f5ab (#2851 native mouse camera, #2852 modding docs), which touch none of this PR's files: the same patch (same patch-id), head d0370602.

Rebased onto the new `mod-api` cb37f5ab (#2851 native mouse camera, #2852 modding docs), which touch none of this PR's files: the same patch (same patch-id), head d0370602.
llun force-pushed fix/mod-api-win-game-test-fixtures from d037060296
All checks were successful
PR description / Title and description (pull_request_target) Successful in 10s
to be13c3919c
All checks were successful
PR description / Title and description (pull_request_target) Successful in 10s
2026-11-30 04:14:36 +00:00
Compare
Author
Member

Rebased onto mod-api @ 12f42db5 (#2855 rustfmt of nav.closest, #2861 menu rows by place): head d03706029 -> be13c3919, the same diff (patch-id unchanged); neither commit touches this PR's files.

Rebased onto mod-api @ 12f42db5 (#2855 rustfmt of nav.closest, #2861 menu rows by place): head d03706029 -> be13c3919, the same diff (patch-id unchanged); neither commit touches this PR's files.
llun force-pushed fix/mod-api-win-game-test-fixtures from be13c3919c
All checks were successful
PR description / Title and description (pull_request_target) Successful in 10s
to 9ac51e8ce2
All checks were successful
PR description / Title and description (pull_request_target) Successful in 5s
2026-11-30 18:13:49 +00:00
Compare
Author
Member

Rebased onto mod-api @ 75bcd270 (#2881 a mod adds a game language): head be13c3919 -> 9ac51e8ce, the same diff (patch-id unchanged); #2881 touches none of this PR's files.

Rebased onto mod-api @ 75bcd270 (#2881 a mod adds a game language): head be13c3919 -> 9ac51e8ce, the same diff (patch-id unchanged); #2881 touches none of this PR's files.
llun force-pushed fix/mod-api-win-game-test-fixtures from 9ac51e8ce2
All checks were successful
PR description / Title and description (pull_request_target) Successful in 5s
to fd71fa754b
All checks were successful
PR description / Title and description (pull_request_target) Successful in 6s
2026-11-30 19:37:48 +00:00
Compare
Author
Member

Rebased onto mod-api af3e4d40 (5 new commits on 75bcd270): head fd71fa754, the same diff (patch-id unchanged). The new mod-api commits touch none of this PR's files.

Rebased onto mod-api af3e4d40 (5 new commits on 75bcd270): head fd71fa754, the same diff (patch-id unchanged). The new mod-api commits touch none of this PR's files.
llun force-pushed fix/mod-api-win-game-test-fixtures from fd71fa754b
All checks were successful
PR description / Title and description (pull_request_target) Successful in 6s
to 24b65c94f1
All checks were successful
PR description / Title and description (pull_request_target) Successful in 7s
2026-11-30 22:35:51 +00:00
Compare
Author
Member

Rebased onto mod-api 716735d8 (6 new commits on top of af3e4d40): head fd71fa754 -> 24b65c94f, the same diff (git patch-id unchanged). The new mod-api touches files near this PR; its checks are to be rerun on this head.

Rebased onto mod-api 716735d8 (6 new commits on top of af3e4d40): head fd71fa754 -> 24b65c94f, the same diff (git patch-id unchanged). The new mod-api touches files near this PR; its checks are to be rerun on this head.
llun force-pushed fix/mod-api-win-game-test-fixtures from 24b65c94f1
All checks were successful
PR description / Title and description (pull_request_target) Successful in 7s
to d177ed3481
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
2026-12-01 00:36:29 +00:00
Compare
Author
Member

Rebased onto mod-api 5780eeda (one new commit on 716735d8, the reverse-engineering tools for hook sites): head 24b65c94f -> d177ed348, the same diff (git patch-id unchanged). The new mod-api commit touches files near this PR (the builder crates, Cargo, CI); its checks are to be rerun on this head before it leaves WIP.

Rebased onto mod-api 5780eeda (one new commit on 716735d8, the reverse-engineering tools for hook sites): head 24b65c94f -> d177ed348, the same diff (git patch-id unchanged). The new mod-api commit touches files near this PR (the builder crates, Cargo, CI); its checks are to be rerun on this head before it leaves WIP.
llun force-pushed fix/mod-api-win-game-test-fixtures from d177ed3481
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
to ee0ac29cef
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
2026-12-01 01:14:08 +00:00
Compare
Author
Member

Rebased onto mod-api 65148a78 (one new commit, photo-mode and effects APIs), now at ee0ac29ce: the same diff (git patch-id unchanged). Checks not rerun on this PC.

Rebased onto mod-api 65148a78 (one new commit, photo-mode and effects APIs), now at ee0ac29ce: the same diff (git patch-id unchanged). Checks not rerun on this PC.
llun force-pushed fix/mod-api-win-game-test-fixtures from ee0ac29cef
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
to be82c33fd3
All checks were successful
PR description / Title and description (pull_request_target) Successful in 6s
2026-12-01 03:16:16 +00:00
Compare
Author
Member

Rebased onto the re-squashed mod-api 041890bb (it now carries main up to #2926 and #2884): only this PR's own commits moved with git rebase --onto, the diff unchanged (same git patch-id). Head be82c33fd (was ee0ac29ce). Checks not rerun here: CI on the new head.

Rebased onto the re-squashed `mod-api` 041890bb (it now carries main up to #2926 and #2884): only this PR's own commits moved with `git rebase --onto`, the diff unchanged (same `git patch-id`). Head be82c33fd (was ee0ac29ce). Checks not rerun here: CI on the new head.
llun force-pushed fix/mod-api-win-game-test-fixtures from be82c33fd3
All checks were successful
PR description / Title and description (pull_request_target) Successful in 6s
to 7332362d91
All checks were successful
PR description / Title and description (pull_request_target) Successful in 5s
2026-12-01 05:15:14 +00:00
Compare
Author
Member

Rebased onto mod-api 5740a5df (two new commits on 041890bb: actors.pose/freeze, and #2902's pool-flag sites in the owners table): head be82c33fd -> 7332362d9, the same diff (git patch-id unchanged). Checks not rerun on this PC: CI on the new head.

Rebased onto mod-api 5740a5df (two new commits on 041890bb: actors.pose/freeze, and #2902's pool-flag sites in the owners table): head be82c33fd -> 7332362d9, the same diff (git patch-id unchanged). Checks not rerun on this PC: CI on the new head.
Author
Member

Closing in favour of #2938: one pull request into mod-api with every fix a Windows test of it found, as asked. This PR's commits are there, rebased onto mod-api @ 5740a5df and checked again there on Windows (in the game, confined, and every game-free check) and Linux; its description lists this one.

Closing in favour of [#2938](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/2938): one pull request into `mod-api` with every fix a Windows test of it found, as asked. This PR's commits are there, rebased onto `mod-api` @ 5740a5df and checked again there on Windows (in the game, confined, and every game-free check) and Linux; its description lists this one.
llun closed this pull request 2026-12-01 06:53:19 +00:00
All checks were successful
PR description / Title and description (pull_request_target) Successful in 5s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2845
No description provided.