app: factor inspect lib_exports' import grouping into a pure function and pin it with unit tests #474

Open
opened 2026-11-27 21:43:23 +00:00 by github-bot · 6 comments
Owner

@⁠AnastasisKon on GitHub · 2026-11-27 21:39 UTC · original

What

apps/victory/src/inspect.rs's lib_exports (behind victory inspect --lib) groups a library file's imports by DLL inline while printing, so the grouping rules — DLL names lowercased, DLLs in name order, each DLL's exports in file order, ordinals rendered as #N — are untested.

What this changes

One change: extract the grouping into a pure imports_by_dll(&[LibImport]) -> BTreeMap<String, Vec<String>> and pin it with unit tests (lowercased keys, BTreeMap order, file order kept within a DLL, ordinal rendering, empty input). No behavior change to the printed output.

How it was tested

  • cargo test -p victory (new tests in apps/victory/src/inspect.rs)
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings
  • cargo xtask policy
  • Game run: not needed (test-only).
**@⁠AnastasisKon** on GitHub · 2026-11-27 21:39 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/470) ## What `apps/victory/src/inspect.rs`'s `lib_exports` (behind `victory inspect --lib`) groups a library file's imports by DLL inline while printing, so the grouping rules — DLL names lowercased, DLLs in name order, each DLL's exports in file order, ordinals rendered as `#N` — are untested. ## What this changes One change: extract the grouping into a pure `imports_by_dll(&[LibImport]) -> BTreeMap<String, Vec<String>>` and pin it with unit tests (lowercased keys, BTreeMap order, file order kept within a DLL, ordinal rendering, empty input). No behavior change to the printed output. ## How it was tested - `cargo test -p victory` (new tests in `apps/victory/src/inspect.rs`) - `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` - `cargo xtask policy` - Game run: not needed (test-only).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 21:43:23 +00:00
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-27 21:39 UTC · original

/claim

**@⁠AnastasisKon** on GitHub · 2026-11-27 21:39 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/470#issuecomment-7228641782) /claim
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-27 21:39 UTC · original

Claimed by @⁠AnastasisKon. Open a draft pull request with Refs #470 in its description within 24 hours, or the claim expires.

**@⁠github-actions[bot]** on GitHub · 2026-11-27 21:39 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/470#issuecomment-7228644496) Claimed by @⁠AnastasisKon. Open a draft pull request with `Refs #470` in its description within 24 hours, or the claim expires.
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-27 21:42 UTC · original

Draft PR up: #475 (branch vibe/inspect-lib-exports-tests-1705ac), CI running; local gates pass (cargo test -p victory, windows clippy, xtask policy).

**@⁠AnastasisKon** on GitHub · 2026-11-27 21:42 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/470#issuecomment-7228691027) Draft PR up: #475 (branch vibe/inspect-lib-exports-tests-1705ac), CI running; local gates pass (cargo test -p victory, windows clippy, xtask policy).
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 12:37 UTC · original

/release - done: PR #475 factors inspect's lib_exports import grouping into a pure function and pins it with unit tests. Carried in my fork's main (69146296).

**@⁠AnastasisKon** on GitHub · 2026-11-28 12:37 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/470#issuecomment-7239353152) /release - done: PR #475 factors inspect's lib_exports import grouping into a pure function and pins it with unit tests. Carried in my fork's `main` (69146296).
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 12:42 UTC · original

/release - done: PR #475 factors inspect's lib_exports import grouping into a pure function and pins it with unit tests. Carried in my fork's main (69146296).

**@⁠AnastasisKon** on GitHub · 2026-11-28 12:42 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/470#issuecomment-7239411284) /release - done: PR #475 factors inspect's lib_exports import grouping into a pure function and pins it with unit tests. Carried in my fork's `main` (69146296).
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-28 12:42 UTC · original

Released. This issue is free to claim.

**@⁠github-actions[bot]** on GitHub · 2026-11-28 12:42 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/470#issuecomment-7239413007) Released. This issue is free to claim.
This discussion has been locked. Commenting is limited to contributors.
No description provided.