fn testThreadName(io: Io, thread: *Thread) !void 1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613fn 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);
}
}
}