tiny.hypothesis.Coverage
Defined in coverage.
API (5)
Actions
Public operations.
Fields and members
Public fields and members.
Source
Source: lib/hypothesis/src/coverage.zig:26
zig
pub const Counters = struct { counts: Counts = .{}, pub fn record(self: *Counters, bucket: Bucket) void { const counter = switch (bucket) { .valid => &self.counts.valid, .invalid => &self.counts.invalid, .boundary => &self.counts.boundary, .large_state => &self.counts.large_state, }; std.debug.assert(counter.* < std.math.maxInt(u64)); counter.* += 1; } pub fn snapshot(self: *const Counters) Counts { return self.counts; } pub fn meets(self: *const Counters, minimum: Counts) bool { for (std.meta.tags(Bucket)) |bucket| { if (self.counts.get(bucket) < minimum.get(bucket)) return false; } return true; } pub fn require(self: *const Counters, minimum: Counts) error{InsufficientCoverage}!void { if (!self.meets(minimum)) return error.InsufficientCoverage; }};Source: lib/hypothesis/src/root.zig:66
zig
pub const Coverage = coverage.Counters;Audit
| Definitions | 5 |
|---|---|
| Public names | 10 |
| Members | 1 |
| Version | 26.7.0 |
| Revision | daab053ee433 |