Skip tests if font family doesn't match

This commit is contained in:
Jacob Sandlund
2026-01-26 10:14:03 -05:00
parent 8ee85d5b85
commit 4f7fcd5956

View File

@@ -2122,6 +2122,15 @@ fn testShaperWithDiscoveredFont(alloc: Allocator, font_req: [:0]const u8) !TestS
defer disco_it.deinit();
var face: font.DeferredFace = (try disco_it.next()) orelse return error.FontNotFound;
errdefer face.deinit();
// Check which font was discovered - skip if it doesn't match the request
var name_buf: [256]u8 = undefined;
const face_name = face.name(&name_buf) catch "(unknown)";
if (std.mem.indexOf(u8, face_name, font_req) == null) {
face.deinit();
return error.SkipZigTest;
}
_ = try c.add(
alloc,
try face.load(lib, .{ .size = .{ .points = 12 } }),