Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
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. Private Function

testThreadName

Private Function
std.Thread.testThreadName
fn testThreadName(io: Io, thread: *Thread) !void

Params

File

Thread.zig:1596
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
fn testThreadName(io: Io, thread: *Thread) !void {
    const testCases: []const []const u8 = &.{
        "mythread",
        &@as([max_name_len]u8, @splat('b')),
    };

    inline for (testCases) |tc| {
        try thread.setName(io, tc);

        var name_buffer: [max_name_len:0]u8 = undefined;

        const name = try thread.getName(&name_buffer);
        if (name) |value| {
            try std.testing.expectEqual(tc.len, value.len);
            try std.testing.expectEqualStrings(tc, value);
        }
    }
}