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 › testJoinMaybeZUefi Private Function testJoinMaybeZUefi Doc Source Private Function std.fs.path.testJoinMaybeZUefi
fn testJoinMaybeZUefi (paths : []const []const u8 , expected : []const u8 , zero : bool ) !void Params paths : []const []const u8 expected : []const u8 zero : bool File fs/path.zig: 173
173
174
175
176
177
178
179
180
181
182 fn testJoinMaybeZUefi (paths : []const []const u8 , expected : []const u8 , zero : bool ) !void {
const uefiIsSep = struct {
fn isSep (byte : u8 ) bool {
return byte == '\\' ;
}
}.isSep ;
const actual = try joinSepMaybeZ (testing .allocator , sep_windows , uefiIsSep , paths , zero );
defer testing .allocator .free (actual );
try testing .expectEqualSlices (u8 , expected , if (zero ) actual [0 .. actual .len - 1 :0 ] else actual );
}