Game tests: every known build's hash is one identify() can match #303
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!303
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/303/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@SkippySteve on GitHub · 2026-11-24 02:11 UTC · original
SkippySteve/victory-pr-own-next22→main· +51 −0 · 1 files · 1 commits · closed without mergingKNOWN_BUILDSis matched against the hex BLAKE3 thatrun.rscomputes for the executable. An entry with a typo, a truncated hash, stray whitespace or a duplicate would compile fine and simply never identify the build it names.victory-game/src/lib.rshas no tests today.This adds a test module (tests only, no behaviour change):
known_builds_are_well_formed: each entry has a label, its hash is 64 lowercase hex digits (the formblake3::Hash::to_hexwrites), and no label or hash appears twice.every_known_build_is_identified_by_its_hash:identify()finds each build by its own hash, in lower or upper case.unknown_hashes_are_not_identified: the BLAKE3 of empty input, an empty string and non-hex text identify nothing.The list is empty on
main, so the first two guard future entries. To check they bite, I temporarily added an entry with an uppercase hash;known_builds_are_well_formedfailed as expected.No game files or new dependencies; it runs on every host.
Tested on Linux:
cargo test -p victory-game: 5 passedcargo clippy -p victory-game --all-targets -- -D warnings: cleancargo fmt -p victory-game -- --check: clean@SkippySteve on GitHub · 2026-11-24 02:32 UTC · original
Superseded by #273, which now carries this commit (KNOWN_BUILDS tests) alongside the other victory-game fix.
Pull request closed