This commit is contained in:
Mitchell Hashimoto
2022-08-29 20:26:02 -07:00
parent 39376feae0
commit 36140d3ee9
3 changed files with 13 additions and 3 deletions

View File

@@ -92,9 +92,13 @@ pub const Cell = struct {
test {
// We use this test to ensure we always get the right size of the attrs
const cell: Cell = .{ .char = 0 };
_ = @bitCast(u8, cell.attrs);
try std.testing.expectEqual(1, @sizeOf(@TypeOf(cell.attrs)));
}
log.warn("CELL={}", .{@sizeOf(Cell)});
test {
//log.warn("CELL={}", .{@sizeOf(Cell)});
try std.testing.expectEqual(16, @sizeOf(Cell));
}
};

View File

@@ -94,10 +94,14 @@ pub const Name = enum(u8) {
};
/// RGB
pub const RGB = struct {
pub const RGB = packed struct {
r: u8,
g: u8,
b: u8,
test {
try std.testing.expectEqual(@as(usize, 3), @sizeOf(RGB));
}
};
test "palette: default" {