Skip to documentation
SLOP

tiny.hypothesis.Settings

Reference tiny.hypothesis Settings

Defined in engine.

API (20)

Actions

Public operations.

Fields and members

Public fields and members.

No direct callersNo direct callsengineSettings
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/hypothesis/src/engine.zig:24

zig
pub const Settings = struct {    max_examples: usize = 100,    max_replays: usize = 100,    max_choices: usize = 4096,    max_input_bytes: usize = conjecture.default_max_input_bytes,    max_shrinks: usize = 5000,    target_examples: usize = 100,    seed: ?u64 = null,    database_path: ?[]const u8 = null,    database_namespace: ?[]const u8 = null,    shrinking: bool = true,    report_failure: bool = true,    per_example_leak_check: bool = false,    pub fn quick() Settings {        return .{            .max_examples = 25,            .max_replays = 25,            .max_choices = 2048,            .max_input_bytes = 256 * 1024,            .max_shrinks = 1000,            .target_examples = 25,        };    }    pub fn dev() Settings {        return .{};    }    pub fn ci() Settings {        return .{            .max_examples = 1000,            .max_replays = 1000,            .max_choices = 8192,            .max_input_bytes = 4 * 1024 * 1024,            .max_shrinks = 20_000,            .target_examples = 1000,        };    }    pub fn withSeed(self: Settings, seed: ?u64) Settings {        var out = self;        out.seed = seed;        return out;    }    pub fn withDatabase(self: Settings, path: ?[]const u8) Settings {        var out = self;        out.database_path = path;        return out;    }    pub fn withNamespace(self: Settings, namespace: ?[]const u8) Settings {        var out = self;        out.database_namespace = namespace;        return out;    }    pub fn withSeedFromEnv(self: Settings) Settings {        if (comptime builtin.os.tag == .windows or builtin.os.tag == .wasi) return self;        const threaded = std.Options.debug_threaded_io orelse return self;        const text = std.process.Environ.getPosix(            threaded.environ.process_environ,            seed_env_name,        ) orelse return self;        return self.withSeedText(text);    }    pub fn withSeedText(self: Settings, text: []const u8) Settings {        var out = self;        if (std.mem.eql(u8, text, "random")) {            out.seed = null;            return out;        }        out.seed = std.fmt.parseUnsigned(u64, text, 0) catch            @panic(seed_env_name ++ " must be an unsigned integer or \"random\"");        return out;    }};

Source: lib/hypothesis/src/root.zig:63

zig
pub const Settings = engine.Settings;
Called byCallsNo direct callstest sourcelib.hypothesis.src.enginetest: settings presets scale property...Settingsci
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callstest sourcelib.hypothesis.src.enginetest: settings presets scale property...Settingsdev
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callstest sourcelib.hypothesis.src.enginetest: result carries replay settingstest sourcelib.hypothesis.src.enginetest: seed text selects fixed, hex, a...test sourcelib.hypothesis.src.enginetest: settings presets scale property...Settingsquick
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersSettingswithSeedTextSettingswithSeedFromEnv
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsSettingswithSeedFromEnvSettingswithSeedText
Static calls · unresolved targets: 0 · external targets: 0.

Audit

Definitions9
Public names18
Members12
Version26.7.0
Revisiondaab053ee433