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 › testJoinMaybeZPosix Private Function testJoinMaybeZPosix Doc Source Private Function std.fs.path.testJoinMaybeZPosix
fn testJoinMaybeZPosix (paths : []const []const u8 , expected : []const u8 , zero : bool ) !void Params paths : []const []const u8 expected : []const u8 zero : bool File fs/path.zig: 195
195
196
197
198
199
200
201
202
203
204 fn testJoinMaybeZPosix (paths : []const []const u8 , expected : []const u8 , zero : bool ) !void {
const posixIsSep = struct {
fn isSep (byte : u8 ) bool {
return byte == '/' ;
}
}.isSep ;
const actual = try joinSepMaybeZ (testing .allocator , sep_posix , posixIsSep , paths , zero );
defer testing .allocator .free (actual );
try testing .expectEqualSlices (u8 , expected , if (zero ) actual [0 .. actual .len - 1 :0 ] else actual );
}