[pr-tests] xtask: test the policy's file size limit itself #72

Manually merged
TrustNo1 merged 1 commit from iboom72/policy-size-limit into main 2026-12-03 20:19:15 +00:00 AGit
Contributor

What it changes

rejects_game_like_files checked the size limit with 600 KiB of a on one line. Since the limit became 1 MiB (MAX_FILE_SIZE), that file is under it. It is still refused, but only as a long hex/base64 run, so the size check itself went untested.

The new test, rejects_only_files_over_the_size_limit, uses short lines so that no other rule applies. A file of exactly MAX_FILE_SIZE bytes is accepted, and one byte more is refused for its size alone. It follows the constant, so it stays right if the limit changes again.

How it was tested

  • Tested revision: a4422096
  • Commands and results: cargo test -p xtask policy: 8 passed, including the new test and repository_passes_policy.
  • Gameplay: not relevant.
  • Coverage gaps: I ran only the xtask tests, not the full workspace gates.

Checklist

  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: none found
## What it changes `rejects_game_like_files` checked the size limit with 600 KiB of `a` on one line. Since the limit became 1 MiB (`MAX_FILE_SIZE`), that file is under it. It is still refused, but only as a long hex/base64 run, so the size check itself went untested. The new test, `rejects_only_files_over_the_size_limit`, uses short lines so that no other rule applies. A file of exactly `MAX_FILE_SIZE` bytes is accepted, and one byte more is refused for its size alone. It follows the constant, so it stays right if the limit changes again. ## How it was tested - Tested revision: a4422096 - Commands and results: `cargo test -p xtask policy`: 8 passed, including the new test and `repository_passes_policy`. - Gameplay: not relevant. - Coverage gaps: I ran only the `xtask` tests, not the full workspace gates. ## Checklist - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: none found
`rejects_game_like_files` checked the limit with 600 KiB of `a` on one
line. Since the limit is 1 MiB that file is under it, and it is refused
only as a long hex/base64 run, so the size check went untested. The new
test checks a file of short lines at exactly the limit (accepted) and
one byte past it (refused, for its size alone).

Port of e83836d3 (2026-11-29) onto the new main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
TrustNo1 manually merged commit 3f08a29b20 into main 2026-12-03 20:19:15 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
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.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!72
No description provided.