std.testing.allocator
- Kind
- constant
- Module
std.testing
Source: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
The entries of std.testing in the Zig reference. This page has 41 cards.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn checkAllAllocationFailures(backing_allocator: std.mem.Allocator, comptime test_fn: anytype, extra_args: CheckAllAllocationFailuresExtraArgs(@TypeOf(test_fn))) !void
Exhaustively check that allocation failures within `test_fn` are handled without introducing memory leaks.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn expect(ok: bool) !void
This function is intended to be used only in tests.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn expectApproxEqAbs(expected: anytype, actual: anytype, tolerance: anytype) !void
This function is intended to be used only in tests.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn expectApproxEqRel(expected: anytype, actual: anytype, tolerance: anytype) !void
This function is intended to be used only in tests.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn expectEqual(expected: anytype, actual: anytype) !void
This function is intended to be used only in tests.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn expectEqualDeep(expected: anytype, actual: anytype) error
This function is intended to be used only in tests.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn expectEqualSentinel(comptime T: type, comptime sentinel: T, expected: [:sentinel]const T, actual: [:sentinel]const T) !void
This function is intended to be used only in tests.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn expectEqualSlices(comptime T: type, expected: []const T, actual: []const T) !void
This function is intended to be used only in tests.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn expectEqualStrings(expected: []const u8, actual: []const u8) !void
it prints diagnostics to stderr to show how they are not equal, then returns an error.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn expectError(expected_error: anyerror, actual_error_union: anytype) !void
This function is intended to be used only in tests.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn expectFmt(expected: []const u8, comptime template: []const u8, args: anytype) !void
This function is intended to be used only in tests.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn expectStringEndsWith(actual: []const u8, expected_ends_with: []const u8) !void
This function is intended to be used only in test.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn expectStringStartsWith(actual: []const u8, expected_starts_with: []const u8) !void
This function is intended to be used only in test.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn failPrint(comptime fmt: []const u8, args: anytype) void
Helper function for printing test failure information.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn failPrintIndicatorLine(source: []const u8, indicator_index: usize) void
Helper function for printing test failure information.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn failPrintLine(line: []const u8) void
Helper function for printing test failure information.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn failPrintWithVisibleNewlines(source: []const u8) void
Helper function for printing test failure information.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn fuzz(context: anytype, comptime testOne: fn (context: @TypeOf(context), smith: *Smith) anyerror!void, options: FuzzInputOptions) anyerror!void
Inline to avoid coverage instrumentation.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
Provides deterministic randomness in unit tests.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
A `Io.Reader` that writes a predetermined list of buffers during `stream`.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn init(buffer: []u8, calls: []const Call) Reader
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
A `Io.Reader` that gets its data from another `Io.Reader`, and always writes to its own buffer (and returns 0) during `stream` and `readVec`.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn init(in: *Io.Reader, buffer: []u8) ReaderIndirect
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn refAllDecls(comptime T: type) void
Given a type, references all the declarations inside, so that the semantic analyzer sees them.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn tmpDir(opts: Io.Dir.OpenOptions) TmpDir
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn cleanup(self: *TmpDir) void
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
A `Io.Writer` that writes its data to another `Io.Writer`, and only writes new data to its own buffer during `drain`.
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.
pub fn init(out: *Io.Writer, buffer: []u8) WriterIndirect
std.testingSource: codeberg.org, ziglang.org. JSON record. This entry is a card. Help write this page.