Add unit tests for console.rs #631

Closed
shayanCSknu wants to merge 1 commit from upstream-pr/631 into main
shayanCSknu commented 2026-11-24 05:57:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by shayanCSknu on 2026-11-24T05:57:01Z.


crates/victory-gpu/src/console.rs had no tests. This adds three:

  • Series X is the default console
  • title_memory() matches the published figures (Series X: 10 GiB + 3.5 GiB; Series S: 7,776 MiB)
  • name() returns the right console names

set()/current() are not tested on purpose: they change a process-wide setting that other tests in the crate read, and tests run in parallel.

Checked locally: cargo test -p victory-gpu console:: passes, cargo clippy is clean, cargo xtask policy passes.

Written with help from Claude (AI).

<!-- greyfinch-sync:Marvisak/VIctory:issue:6575644497 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/631). Originally posted by [shayanCSknu](https://github.com/shayanCSknu) on 2026-11-24T05:57:01Z. --- `crates/victory-gpu/src/console.rs` had no tests. This adds three: - Series X is the default console - `title_memory()` matches the published figures (Series X: 10 GiB + 3.5 GiB; Series S: 7,776 MiB) - `name()` returns the right console names `set()`/`current()` are not tested on purpose: they change a process-wide setting that other tests in the crate read, and tests run in parallel. Checked locally: `cargo test -p victory-gpu console::` passes, `cargo clippy` is clean, `cargo xtask policy` passes. Written with help from Claude (AI).
mercuryVM commented 2026-11-24 09:05:49 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T08:08:20Z.

Review: APPROVED


Tested e009e13 on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (267 passed, 0 failed).

These are test-only additions. They pin the documented memory split (Series X 10 GiB + 3.5 GiB, Series S 7,776 MiB), the default console and the names. Leaving set/current untested is the right call, since they are process-global and the crate's tests run in parallel.

No issues found.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6035682361 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/631#pullrequestreview-6035682361). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T08:08:20Z. **Review:** APPROVED --- Tested e009e13 on Windows 11, RTX 5070, MSVC: `cargo test --workspace --no-fail-fast` passes (267 passed, 0 failed). These are test-only additions. They pin the documented memory split (Series X 10 GiB + 3.5 GiB, Series S 7,776 MiB), the default console and the names. Leaving `set`/`current` untested is the right call, since they are process-global and the crate's tests run in parallel. No issues found. AI-assisted (Claude Code).
geiyiliyabumo commented 2026-11-24 13:02:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T12:23:52Z.


Independent verification & code review on Windows 11 x64 MSVC (merged onto main ffe310e):

Checks Run

  • cargo xtask policy: PASS (154 files ok)
  • cargo clippy -p victory-gpu --all-targets --locked -- -D warnings (default + --features diagnostics): PASS (0 warnings)
  • cargo test -p victory-gpu --locked -- console::: PASS (3/3 tests)

Review

Looks clean and ready to merge — all three unit tests verify Console::default(), title_memory(), and name() accurately without mutating the process-wide set()/current() state, keeping parallel crate tests isolated.

AI-assisted; synthetic tests only, no game files.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7131381139 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/631#issuecomment-7131381139). Originally posted by [geiyiliyabumo](https://github.com/geiyiliyabumo) on 2026-11-24T12:23:52Z. --- Independent verification & code review on Windows 11 x64 MSVC (merged onto `main` `ffe310e`): ### Checks Run - `cargo xtask policy`: **PASS** (`154 files ok`) - `cargo clippy -p victory-gpu --all-targets --locked -- -D warnings` (default + `--features diagnostics`): **PASS** (0 warnings) - `cargo test -p victory-gpu --locked -- console::`: **PASS** (`3/3` tests) ### Review Looks clean and ready to merge — all three unit tests verify `Console::default()`, `title_memory()`, and `name()` accurately without mutating the process-wide `set()`/`current()` state, keeping parallel crate tests isolated. *AI-assisted; synthetic tests only, no game files.*
DenRakEiw commented 2026-11-24 14:04:18 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T13:48:45Z.

Review: APPROVED


Tested merged cleanly onto main (ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC, NVIDIA RTX 5090):

  • cargo test -p victory-gpu: 53 passed, 0 failed, 1 ignored (including all 3 new console::tests::* unit tests)
  • cargo clippy -p victory-gpu --all-targets: 0 warnings
  • cargo xtask policy: ok

Clean, focused unit test coverage for Console defaults, memory budgets, and display names. Approving.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6040355677 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/631#pullrequestreview-6040355677). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-24T13:48:45Z. **Review:** APPROVED --- Tested merged cleanly onto `main` (`ffe310e`) on Windows 11 x64 (Rust 1.98.1 MSVC, NVIDIA RTX 5090): - `cargo test -p victory-gpu`: **53 passed, 0 failed, 1 ignored** (including all 3 new `console::tests::*` unit tests) - `cargo clippy -p victory-gpu --all-targets`: **0 warnings** - `cargo xtask policy`: ok Clean, focused unit test coverage for `Console` defaults, memory budgets, and display names. Approving. AI-assisted (Gemini 4 Neon).
upstream-sync closed this pull request 2026-11-25 01:04:33 +00:00
Marvisak commented 2026-11-25 01:07:48 +00:00 (Migrated from github.com)

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


Automated triage for the maintainers. Closing because it does not change behaviour the project needs (formatting, guards for cases that cannot occur, or notes and translations that cannot be kept current).

Three tests that restate console.rs's constants (default, memory split, names) back to themselves; no behaviour is covered and the Series S figure is marked as a shortcut to be changed.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148513236 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/631#issuecomment-7148513236). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:26:31Z. --- Automated triage for the maintainers. Closing because it does not change behaviour the project needs (formatting, guards for cases that cannot occur, or notes and translations that cannot be kept current). Three tests that restate console.rs's constants (default, memory split, names) back to themselves; no behaviour is covered and the Series S figure is marked as a shortcut to be changed. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Pull request closed

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!631
No description provided.