Expand description
#2841: the checker-side rules for a suite’s fixture name = "path"
declarations — the path rules and the content rules shared with embed
(crate::embeds, crate::assets) but for the project’s fixtures/
folder, the name rules, and the unused warning.
A fixture is a project file’s text, a String constant in the declaring
suite’s cases. Unlike an embed it is test-only: its text goes into test
output and never into a deployable, so it comes from fixtures/ (not
embeds/), may be large (MAX_FIXTURE_BYTES), and has no project total.
The checker stays disk-free: the folder reaches it from the caller as a
[bynk_project::assets::FixtureFolder], and read_declared_fixtures reads
only the files a declaration names.
Constants§
- MAX_
FIXTURE_ BYTES - The largest fixture file, in bytes. A fixture never ships, so the cap only keeps a test module a reasonable size; there is no project total.
Functions§
- check_
suite_ fixtures - The name rules and the unused warning for one suite’s fixtures.
- outside_
fixtures_ dir_ error bynk.fixture.outside_fixtures_dirforf, when its path is safe but does not lie inside the project’s fixtures folder, so a declaration can never read.envor a source file by mistake.- path_
errors - The path rules for
f, in order (at most one applies). - phase_
fixture_ files - The path errors (
path_errors) for each fixture, andbynk.fixture.missing_filefor each whose (otherwise valid) path names no file inavailable— the project’sfixtures/folder as the caller read it.Noneskips the check (nothing on disk was consulted). - read_
declared_ fixtures - The text of every declared fixture file in
folder, keyed by normalised path — read through the folder’s reader once each, and only for a file a declaration names. Content rules are an embed’s (crate::embeds::embedded_text): valid UTF-8 (bynk.fixture.invalid_encoding), no NUL byte (bynk.fixture.binary_content), a BOM dropped and newlines normalised; and at mostMAX_FIXTURE_BYTES(bynk.fixture.too_large). A read failure isbynk.fixture.unreadable_file. Each is reported on every declaration that names the file, and the file is left out. - unsafe_
path_ error bynk.fixture.unsafe_pathforf, when its path is empty, absolute or contains a..segment (the rule an asset’s and an embed’s paths follow).