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 › fs › path › testJoinMaybeZWindows Private Function testJoinMaybeZWindows Doc Source Private Function std.fs.path.testJoinMaybeZWindows
fn testJoinMaybeZWindows (paths : []const []const u8 , expected : []const u8 , zero : bool ) !void Params paths : []const []const u8 expected : []const u8 zero : bool File fs/path.zig: 184
184
185
186
187
188
189
190
191
192
193 fn testJoinMaybeZWindows (paths : []const []const u8 , expected : []const u8 , zero : bool ) !void {
const windowsIsSep = struct {
fn isSep (byte : u8 ) bool {
return byte == '/' or byte == '\\' ;
}
}.isSep ;
const actual = try joinSepMaybeZ (testing .allocator , sep_windows , windowsIsSep , paths , zero );
defer testing .allocator .free (actual );
try testing .expectEqualSlices (u8 , expected , if (zero ) actual [0 .. actual .len - 1 :0 ] else actual );
}