Skip to documentation
SLOP

tiny.hypothesis

Reference tiny.hypothesis

Overview · API · Code relationships · Verification · Audit

Overview

Runs tests by searching for inputs that make a test fail. A function that draws its inputs and fails when the claim under test fails for them is a property. Every draw goes through the run's data object, which appends the choice with its kind, its value, and the bounds it was drawn within. The recorded list of the draws a property made is the choice sequence. Because the draws are recorded in order, a later run can feed the same sequence back into the same generator and get the same input.

The search for a smaller choice sequence that still fails is shrinking. A generator can label a range of the choice sequence, opened and closed around a part of the generator, as a span, which gives shrinking a unit to delete or simplify. Shrinking replays a candidate sequence through the property and keeps the candidate when the property still fails, within the run's shrink budget. The passes delete spans, replace a span with its simplest value, and reduce individual choices.

A property can report a finite number to say how interesting its input was as a target score, and the engine then spends a further budget mutating the best-scoring sequence to raise that score.

A failing sequence is saved to the directory called the failure database and replayed first on the next run. Limits for one run, called settings, bound a run by examples, replays, choices, input bytes, shrinks, and targeted attempts, with quick, dev, and ci presets scaling all of them together.

Definitions

Actions

Public operations.

Types and contracts

Public types and contracts.

Namespaces

Public namespaces.

Code relationships

Direct static dependencies extracted from parsed source by semantic graph analysis.

Uses: tiny.bench, tiny.bumpalo, tiny.smg
Used by: tiny.accy, tiny.arrange, tiny.bench, tiny.bumpalo, tiny.chant, tiny.choir, tiny.closure, tiny.coz, tiny.css, tiny.deadalloc, tiny.deflate, tiny.filigree, tiny.geometry, tiny.gif, tiny.gpalloc, tiny.gui, tiny.http, tiny.linear, tiny.machine, tiny.markdown, tiny.memtrace, tiny.mprompt, tiny.pdf, tiny.peer, tiny.pluck, tiny.png, tiny.preserves, tiny.python, tiny.quic, tiny.reducer, tiny.reticulum, tiny.rig, tiny.sandbox, tiny.sdfii, tiny.simd, tiny.smt, tiny.sql, tiny.stabilizer, tiny.stun, tiny.syn, tiny.sys, tiny.tldr, tiny.trace, tiny.ui, tiny.wayland, tiny.windowing, tiny.xkb

Verification

No verification records are cataloged for this module in this build.

Audit

EvidenceValue
Sourcelib/hypothesis/src/root.zig
Definitions0 of 54 documented
Members0 of 0 documented
Public names54 API, 254 indexed
Version26.7.0
Revisiondaab053ee433
Unresolved targets1