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 standard library.
std › compress › flate › Compress › testingCheckContainerHash Private Function testingCheckContainerHash Doc Source 1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475 fn testingCheckContainerHash (
expected_size : u32 ,
expected_hash : flate .Container .Hasher ,
actual_hash : flate .Container .Hasher ,
actual_size : u32 ,
actual_meta : flate .Container .Metadata ,
) !void {
try std .testing .expectEqual (expected_size , actual_size );
switch (actual_hash ) {
.raw => {},
.gzip => |gz | {
const expected_crc = expected_hash .gzip .crc .final ();
try std .testing .expectEqual (expected_size , actual_meta .gzip .count );
try std .testing .expectEqual (expected_crc , gz .crc .final ());
try std .testing .expectEqual (expected_crc , actual_meta .gzip .crc );
},
.zlib => |zl | {
const expected_adler = expected_hash .zlib .adler ;
try std .testing .expectEqual (expected_adler , zl .adler );
try std .testing .expectEqual (expected_adler , actual_meta .zlib .adler );
},
}
}