Skip to main content

read_declared_fixtures

Function read_declared_fixtures 

Source
pub fn read_declared_fixtures(
    parsed: &[ParsedFile],
    folder: &FixtureFolder,
    errors: &mut ErrorSink,
) -> BTreeMap<String, String>
Expand description

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 most MAX_FIXTURE_BYTES (bynk.fixture.too_large). A read failure is bynk.fixture.unreadable_file. Each is reported on every declaration that names the file, and the file is left out.