config(0) without PROPTEST_CASES, or PROPTEST_CASES=0, now panics instead of
letting a property suite pass without running a case. The prop tests move
from their own test target into tests/it/prop.rs, behind the prop feature.
For a value it does not know, proptest prints a warning and falls back
to ChaCha, so a reproduction run with a misspelled algorithm used a
different generator and could pass. `config` now parses the variable
itself: `xs`, `cc` and `rc` select their generators, `pt` and any other
value make it panic, and an unset variable keeps the generator from
`Config::default()`.
`TempDir::new_in` passed the root to `tempfile` as given, so when the root was
reached through a link that changed during the test, `path()` named the old
folder while drop and `close()` resolved the link again: the folder that was
made stayed and a folder with the same name under the new target could be
removed. The root is now canonicalized before the folder is made, and the
symlink-root test retargets the link before the drop.
On Unix a umask that removes owner read, write or search permission left the
new folder unusable (for example mode 0o300) while `TempDir::new` returned
Ok, since the owner probe needs only write and search; cleanup then failed.
`check` now returns PermissionDenied unless the owner has all three, before
the probe runs.
`TempDir::new` and `TempDir::file` also return InvalidInput for `<`, `>`,
`"`, `|`, `?`, `*` and control characters, which Windows does not allow in a
file name, on every platform. The README and doc comments list them.
The crate-level summary of `temp::TempDir` now states that the Unix check
reads the mode bits and does not read POSIX or NFSv4 access control lists,
matching `temp.rs` and the README.
`config` keeps the fork mode that `PROPTEST_FORK` or `PROPTEST_TIMEOUT`
turns on. The doc comment now says that `TestRunner::run` then needs
`test_name`, which the named-test form of `proptest!` sets.
The pass-through generator reads caller-supplied bytes instead of a u64
seed, so a runner built from `config` with `PROPTEST_RNG_ALGORITHM=pt`
panicked inside proptest with a message that did not name the variable.
`config` now panics with a message naming `PROPTEST_RNG_ALGORITHM`.
New child-process tests cover the rejected `pt` value and check that the
XorShift generator (`xs`) is kept with the pinned seed and repeats its draws.
`prop::config` uses `Config::rng_seed` and `RngSeed`, which proptest added
in 1.7, so the workspace requirement moves from "1" to "1.7". The locked
1.12.0 already satisfies it.
The README now says that `config` keeps the generator chosen by
`PROPTEST_RNG_ALGORITHM`, and that repeating a failing run needs the same
algorithm and other `PROPTEST_*` settings as well as the seed and count.
temp.rs calls TempDir::disable_cleanup, which tempfile 3.20.0 added, so
the dependency now asks for 3.20. The crate docs no longer link
temp::TempDir, which is not built for wasm32, and say the folder is
private on Unix and that removal on drop is best effort. The READMEs say
the same, that the umask can remove more bits from the requested 0o700,
and that the Unix check reads mode bits only, not access control lists.
The README's process-wide capture example called drop_the_plugin
without defining it, so a copied test did not compile. The example now
defines it as a function that logs a warning containing the text the
assertion looks for.
generate and generate_with no longer keep their own required variable
and skip_or_fail. A fixture that cannot be made now goes through
skip::skip with the variable generate is given (default
CRAFT_TEST_REQUIRED): unset or empty prints `SKIPPED: <reason>`, `1`
fails the test, and any other value, `0` included, fails it as a
configuration error. generate_with keeps the caller's required value
and prints the same skip line. The README paragraph and the test of the
variable's values follow the new rule.
with_deadline returns a result that arrives before the limit is checked,
and wait_until checks its condition once for any number of raises that
came during one call of it.
The limit restarted after every call of the condition, so a thread that
kept raising the signal while the condition stayed false held wait_until
forever. The limit now counts from the start of the call, and each wait
lasts at most the time left. The condition is still called before the
limit is checked, so a condition that holds never fails.
Two tests cover it: an injected clock with a wait that always reports a
raise, and a real thread raising in a loop under with_deadline. Both
fail without the change.
with_deadline failed a body that returned or panicked after its limit, and
hammer failed a case that finished after its per-case limit, so a slow
runner could fail a test whose code was correct. Both now take whatever the
body or case produced, however late it arrives, and fail on the limit only
when nothing has arrived by then.
wait_until polled its condition with sleeps against a clock and failed a
true that came after the limit. It now takes a Signal: the condition is
called at once and again each time another thread calls Signal::raise, and
the limit only fails a wait that saw no raise in that time. A raise made
while the condition runs is not lost. No crate in this workspace calls
wait_until.
The tests use an injected wait for the limit and an injected clock instead
of real 50 ms limits, and new tests cover a value or panic that arrives
after the limit, a case that finishes after its limit, and a raise during
the condition. The tests of the removed behavior (a late result fails, the
pause schedule of the polling loop) are replaced by these.
- decode_png rejects a bad CRC on any ancillary chunk, before or after
the image data, instead of skipping the chunk.
- decode_png reads the output color type after read_info and checks the
size after conversion to RGBA, and both sizes against isize::MAX,
before it allocates the frame buffer. Gray and RGBA frames keep the
decoder's buffer instead of copying it.
- PNG encoding streams compressed data into the bounded sink, so an
output over max_input_bytes stops compression early.
- When the failure images of a golden mismatch cannot be encoded or
written, check_golden returns GoldenMismatchUnsaved with the verdict
and the error instead of the error alone.
- max_decoded_bytes documents the decoder working-memory budget as best
effort; the returned pixels stay a hard limit.
- Module docs use code spans for items that do not build for wasm32.
- Comparison tests call check_golden_with with blessing off, and the
assert_similar! tests run in a child process without the bless
variable.
pinned now fails the test when the folder variable name is empty or
holds `=` or a NUL character, before the environment is read, instead
of reading it as unset and skipping. The docs of verify and the README
also state what the containment check after the open covers on each
platform, that an Apple path query error fails verification, and that
the manifest parser does not check names against a file system's rules.
The overlap check treated a table of length 0 whose offset points inside
the name or head table as sharing bytes, so rename_family returned
MalformedFont for a valid face. An overlap now needs at least one shared
byte. Nonempty overlapping tables are still refused.
On Windows the folder gets the inheritable access entries of the
temporary directory and is not checked. The module docs and README now
say so, and that a TMP or TEMP naming a shared folder may let other
users open it.