Zig 0.17.0-dev (Split by item)
This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig library itself.
Zig › std/ › math/ › big/ › int.zig › testOneShiftCaseNoAliasing
testOneShiftCaseNoAliasing
int.testOneShiftCaseNoAliasing
fn testOneShiftCaseNoAliasing (func : fn ([]Limb , []const Limb , usize ) usize , case : Case ) !void
File
Code
fn testOneShiftCaseNoAliasing (func : fn ([]Limb , []const Limb , usize ) usize , case : Case ) !void {
const padding = maxInt (Limb );
var r : [20 ]Limb = @splat (padding );
const shift = case [0 ];
const expected = case [1 ];
const data = case [2 ];
std .debug .assert (expected .len <= 20 );
const len = func (&r , data , shift );
try std .testing .expectEqual (expected .len , len );
try std .testing .expectEqualSlices (Limb , expected , r [0 ..len ]);
try std .testing .expect (mem .allEqual (Limb , r [len ..], padding ));
}