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/ › fs/ › path.zig › testCompareDiskDesignators
testCompareDiskDesignators
path.testCompareDiskDesignators
fn testCompareDiskDesignators (expected_result : bool , kind : DiskDesignatorKind , p1 : []const u8 , p2 : []const u8 ) !void
File
Code
fn testCompareDiskDesignators (expected_result : bool , kind : DiskDesignatorKind , p1 : []const u8 , p2 : []const u8 ) !void {
var wtf16_buf1 : [256 ]u16 = undefined ;
const w1_len = try std .unicode .wtf8ToWtf16Le (&wtf16_buf1 , p1 );
var wtf16_buf2 : [256 ]u16 = undefined ;
const w2_len = try std .unicode .wtf8ToWtf16Le (&wtf16_buf2 , p2 );
try std .testing .expectEqual (expected_result , compareDiskDesignators (u8 , kind , p1 , p2 ));
try std .testing .expectEqual (expected_result , compareDiskDesignators (u16 , kind , wtf16_buf1 [0 ..w1_len ], wtf16_buf2 [0 ..w2_len ]));
}