Expand description
Adversarial input generators.
These generators produce inputs that exercise failure paths: oversized files, malformed UTF-8, unusual filenames. Every generator is deterministic given a seed (where applicable).
§Use cases
- Oversized: confirm that buffer-allocation paths handle files larger than common assumptions.
- Malformed UTF-8: confirm that decoders return errors instead of panicking on invalid bytes.
- Unusual names: confirm that path-handling code copes with Unicode, emoji, very long names, etc.
Functions§
- malformed_
utf8 - Write a deliberately malformed UTF-8 byte sequence to
path. - oversized_
sparse - Write
size_bytestopathusingset_len, which on most platforms creates a sparse file (no actual disk space used until written to). - oversized_
zeros - Write
size_bytesof zeroes topath. The parent directory MUST exist. - random_
bytes - Write
ndeterministic bytes topathusing a splitmix64-derived stream seeded byseed. - unusual_
names - Names that are valid on most filesystems but exercise edge cases: long names, Unicode, emoji, leading dot.