HLE tests: cover Windows path rules on every host #290

Open
Quat3rnion wants to merge 1 commit from upstream-pr/290 into main
Quat3rnion commented 2026-11-24 02:04:12 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Quat3rnion on 2026-11-24T02:04:12Z.


What

The plan asks for Linux-independent tests of the Windows path semantics so
the branches stay covered on CI. The rules lived inside the Windows-only
files module, where Linux could not reach them. This moves the lexical
decisions — drive letters and casing, X: relative roots, slash handling,
\\?\ paths, UNC conversion, dot segments and the long-path threshold —
into a host-independent paths module with seven tests. files.rs keeps
the host calls and delegates to the same functions; there is no behaviour
change.

An AI tool wrote part of this change.

Tested

  • Linux: cargo test --workspace with PR #112's Linux build fix applied locally (not part of this PR): 171 passed, 0 failed, 3 ignored. The seven new path tests pass on Linux.
  • Windows cross-build: cargo check --target x86_64-pc-windows-gnu --workspace --tests passes. The Windows-only files tests were not run; there is no Windows host here.
  • cargo xtask policy passes (151 files ok). No game files or data from them were added.
  • Not tested: a real title. The extracted rules are the existing ones, unchanged.

Checklist

  • Workspace tests and Windows cross-check pass as described.
  • cargo xtask policy passes. No game files or data from them were added.
  • AI authorship is disclosed above.
<!-- greyfinch-sync:Marvisak/VIctory:issue:5464682031 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/290). Originally posted by [Quat3rnion](https://github.com/Quat3rnion) on 2026-11-24T02:04:12Z. --- ## What The plan asks for Linux-independent tests of the Windows path semantics so the branches stay covered on CI. The rules lived inside the Windows-only `files` module, where Linux could not reach them. This moves the lexical decisions — drive letters and casing, `X:` relative roots, slash handling, `\\?\` paths, UNC conversion, dot segments and the long-path threshold — into a host-independent `paths` module with seven tests. `files.rs` keeps the host calls and delegates to the same functions; there is no behaviour change. An AI tool wrote part of this change. ## Tested - Linux: `cargo test --workspace` with PR #112's Linux build fix applied locally (not part of this PR): 171 passed, 0 failed, 3 ignored. The seven new path tests pass on Linux. - Windows cross-build: `cargo check --target x86_64-pc-windows-gnu --workspace --tests` passes. The Windows-only `files` tests were not run; there is no Windows host here. - `cargo xtask policy` passes (151 files ok). No game files or data from them were added. - Not tested: a real title. The extracted rules are the existing ones, unchanged. ## Checklist - [x] Workspace tests and Windows cross-check pass as described. - [x] `cargo xtask policy` passes. No game files or data from them were added. - [x] AI authorship is disclosed above.
jeremygold02 commented 2026-11-24 06:55:40 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T04:17:37Z.


Tested PR #290 at head 8b288a11bf341f849875ab3e6072e5402d65de17 (state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged at 8b288a11bf341f849875ab3e6072e5402d65de17.

  • cargo test --locked -p victory-hle narrow_drive_detection_precedes_decoding — passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 87 filtered out; finished in 0.00s ); cases: modules::paths::tests::narrow_drive_detection_precedes_decoding.

Behavior covered: Checks Windows drive detection before narrow-path decoding and covers drive-relative, verbatim, long and UNC path rewriting on the host.
Code: crates/victory-hle/src/modules/paths.rs, crates/victory-hle/src/modules/files.rs

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121885575 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/290#issuecomment-7121885575). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-24T04:17:37Z. --- Tested PR #290 at head `8b288a11bf341f849875ab3e6072e5402d65de17` (state at test time: OPEN). Pre-comment refresh: state OPEN, head unchanged at `8b288a11bf341f849875ab3e6072e5402d65de17`. - `cargo test --locked -p victory-hle narrow_drive_detection_precedes_decoding` — passed (ok. 1 passed; 0 failed; 0 ignored; 0 measured; 87 filtered out; finished in 0.00s ); cases: modules::paths::tests::narrow_drive_detection_precedes_decoding. Behavior covered: Checks Windows drive detection before narrow-path decoding and covers drive-relative, verbatim, long and UNC path rewriting on the host. Code: [crates/victory-hle/src/modules/paths.rs](https://github.com/Marvisak/VIctory/blob/8b288a11bf341f849875ab3e6072e5402d65de17/crates/victory-hle/src/modules/paths.rs), [crates/victory-hle/src/modules/files.rs](https://github.com/Marvisak/VIctory/blob/8b288a11bf341f849875ab3e6072e5402d65de17/crates/victory-hle/src/modules/files.rs)
mercuryVM commented 2026-11-24 13:16:36 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T13:16:36Z.

Review: APPROVED


Tested e9caf0a on Windows 11, RTX 5070, MSVC: cargo test -p victory-hle 94 passed, including the seven new paths tests.

  • Moving the lexical rules (drive letters, X: relative roots, separators, \?\ and UNC forms, dot segments, the 248 long-path threshold) into a host-independent paths module, with files.rs delegating to it, keeps Windows behaviour identical, and the existing files tests still pass. It also lets non-Windows CI cover those branches.
  • Nit, new clippy warning: paths.rs:184, "useless use of format!". The other warning (xmem.rs:747) was already there.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6039855499 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/290#pullrequestreview-6039855499). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T13:16:36Z. **Review:** APPROVED --- Tested e9caf0a on Windows 11, RTX 5070, MSVC: `cargo test -p victory-hle` 94 passed, including the seven new `paths` tests. - Moving the lexical rules (drive letters, `X:` relative roots, separators, `\?\` and UNC forms, dot segments, the 248 long-path threshold) into a host-independent `paths` module, with `files.rs` delegating to it, keeps Windows behaviour identical, and the existing `files` tests still pass. It also lets non-Windows CI cover those branches. - Nit, new clippy warning: `paths.rs:184`, "useless use of `format!`". The other warning (xmem.rs:747) was already there. AI-assisted (Claude Code).
Marvisak commented 2026-11-25 01:07:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:26:03Z.


Automated triage for the maintainers.

Needs rebase. This PR does not merge cleanly into current main (ac2525d). Conflicting files: crates/victory-hle/src/modules/mod.rs.

The content has not been reviewed yet; it will be once the branch is rebased onto main.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148505371 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/290#issuecomment-7148505371). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:26:03Z. --- <!-- victory-triage v1 head=ae6ebd9ec2708307806ea966f2a9f5237e20b56a verdict=needs-rebase at=2026-11-25T00:13:20Z --> Automated triage for the maintainers. **Needs rebase.** This PR does not merge cleanly into current `main` (ac2525d). Conflicting files: `crates/victory-hle/src/modules/mod.rs`. The content has not been reviewed yet; it will be once the branch is rebased onto `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/290:upstream-pr/290'
git switch 'upstream-pr/290'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/290'
git switch 'upstream-pr/290'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/290'
git switch 'upstream-pr/290'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/290'
git switch 'main'
git merge --squash 'upstream-pr/290'
git switch 'main'
git merge --ff-only 'upstream-pr/290'
git switch 'main'
git merge 'upstream-pr/290'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
Marvisak/VIctory!290
No description provided.