tiny.hypothesis.Settings
Defined in engine.
API (20)
Actions
Public operations.
Fields and members
Public fields and members.
database_namespacedatabase_pathmax_choicesmax_examplesmax_input_bytesmax_replaysmax_shrinksper_example_leak_checkreport_failureseedshrinkingtarget_examples
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;Audit
| Definitions | 9 |
|---|---|
| Public names | 18 |
| Members | 12 |
| Version | 26.7.0 |
| Revision | daab053ee433 |