Skip to content

BCPack tests: the reference-chunk test uses the shipped tables - #316

Closed
SkippySteve wants to merge 1 commit into
Marvisak:mainfrom
SkippySteve:SkippySteve/victory-pr-own-next21
Closed

SkippySteve wants to merge 1 commit into
Marvisak:mainfrom
SkippySteve:SkippySteve/victory-pr-own-next21

Conversation

@SkippySteve

Copy link
Copy Markdown

The BCPack tables ship in the tree (bcpack-tables.bin, read by Tables::builtin), but the opt-in reference_chunks test still demanded VICTORY_BCPACK_TABLES and panicked with VICTORY_BCPACK_TABLES when it was unset. Anyone with reference chunks had to point it at a copy of a file that already sits beside the code.

Now:

  • VICTORY_BCPACK_CASES is the only required variable; the test uses Tables::builtin() by default.
  • VICTORY_BCPACK_TABLES still works as an override for checking a different table file.
  • The #[ignore] reason says what is actually missing (reference chunks outside the repository).

Test-only change in crates/victory-formats/src/bcpack.rs; no decoder code touched.

Testing (Linux)

  • cargo test -p victory-formats: 20 passed, 3 ignored
  • cargo clippy -p victory-formats --all-targets -- -D warnings: clean
  • cargo xtask policy: ok
  • Ran the ignored test both ways against synthetic chunks made by decoding random input with the built-in tables (kept in a scratch directory outside the repo, not committed):
    • VICTORY_BCPACK_CASES=<dir> cargo test -p victory-formats reference_chunks -- --ignored: passes (it panicked on main)
    • the same plus VICTORY_BCPACK_TABLES=crates/victory-formats/src/bcpack-tables.bin: passes

The format's tables now ship in-tree (Tables::builtin), but the ignored
reference_chunks test still panicked unless VICTORY_BCPACK_TABLES named a
table file. It now uses the built-in tables by default; the variable stays
as an override for comparing another table file. Only VICTORY_BCPACK_CASES
is required.
@SkippySteve

Copy link
Copy Markdown
Author

Folded into #315 to keep the PR count down. The commit is unchanged there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant