From 25cf4eac43199e1220609703a3e166ab7840bdd8 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 4 Mar 2023 14:45:34 -0800 Subject: [PATCH] don't need to set all sprite values in enum --- src/font/sprite.zig | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/font/sprite.zig b/src/font/sprite.zig index 0065b56f1..c3c311b35 100644 --- a/src/font/sprite.zig +++ b/src/font/sprite.zig @@ -15,16 +15,21 @@ pub const Sprite = enum(u32) { pub const end: u32 = std.math.maxInt(u32); underline = start, - underline_double = start + 1, - underline_dotted = start + 2, - underline_dashed = start + 3, - underline_curly = start + 4, + underline_double, + underline_dotted, + underline_dashed, + underline_curly, // Note: we don't currently put the box drawing glyphs in here because // there are a LOT and I'm lazy. What I want to do is spend more time // studying the patterns to see if we can programmatically build our // enum perhaps and comptime generate the drawing code at the same time. // I'm not sure if that's advisable yet though. + + test { + const testing = std.testing; + try testing.expectEqual(start, @enumToInt(Sprite.underline)); + } }; test {