diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-09 00:52:52 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-09 01:28:28 -0300 |
| commit | 5157579ff7f9ae0cfc3c7629e953da05bce340fc (patch) | |
| tree | 02147789efdcea998981efcfe05d4bcb3e9bb7b0 /src/Art.zig | |
| parent | 4c4b9bf54d77dbc0f9f4e2619746908e501c6001 (diff) | |
| download | pardes-5157579ff7f9ae0cfc3c7629e953da05bce340fc.tar.gz pardes-5157579ff7f9ae0cfc3c7629e953da05bce340fc.zip | |
tests: at the end of their files: every top-level test block of the 46 files that had one mid-file (the locality analysis's 45 and test/hxdiff.zig; gui.zig, macos.zig, look, host_io, 9p_io, terminal, tui, mouse, fs, replica, layout among them, 11,429 test lines), with the functions only tests call, moved after the file's code in their order, a mechanical move (.scratch/suites/tests_to_end.py), zig fmt'd; the unit suites pass as before (tui 1486/1487, gui 1536/1537, core 956/956 on both), macos.zig only parse-checked here
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/Art.zig')
| -rw-r--r-- | src/Art.zig | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/src/Art.zig b/src/Art.zig index 6a938f68..6cc33e2e 100644 --- a/src/Art.zig +++ b/src/Art.zig @@ -466,6 +466,34 @@ fn renderRect(gpa: std.mem.Allocator, raster: Raster, src: RectPx, cols: usize, return .{ .cells = cells, .cols = cols, .rows = rows }; } +pub const terminal_palette = [16][3]u8{ + .{ 0x1D, 0x1F, 0x21 }, // black + .{ 0xCC, 0x66, 0x66 }, // red + .{ 0xB5, 0xBD, 0x68 }, // green + .{ 0xF0, 0xC6, 0x74 }, // yellow + .{ 0x81, 0xA2, 0xBE }, // blue + .{ 0xB2, 0x94, 0xBB }, // magenta + .{ 0x8A, 0xBE, 0xB7 }, // cyan + .{ 0xC5, 0xC8, 0xC6 }, // white + .{ 0x66, 0x66, 0x66 }, // bright black + .{ 0xD5, 0x4E, 0x53 }, // bright red + .{ 0xB9, 0xCA, 0x4A }, // bright green + .{ 0xE7, 0xC5, 0x47 }, // bright yellow + .{ 0x7A, 0xA6, 0xDA }, // bright blue + .{ 0xC3, 0x97, 0xD8 }, // bright magenta + .{ 0x70, 0xC0, 0xB1 }, // bright cyan + .{ 0xEA, 0xEA, 0xEA }, // bright white +}; + +comptime { + for (terminal_palette, 0..) |rgb, i| { + const c = ghostty_vt.color.default[i]; + if (rgb[0] != c.r or rgb[1] != c.g or rgb[2] != c.b) @compileError( + "terminal palette differs from the emulator", + ); + } +} + test "sextant codepoints: blocks + endpoints" { try std.testing.expectEqual(@as(u21, ' '), sextantCp(0)); try std.testing.expectEqual(@as(u21, 0x2588), sextantCp(63)); @@ -543,33 +571,6 @@ test "a tiny image fitted into cells makes a grid within bounds" { try std.testing.expect(g.rows >= 1 and g.rows <= 10); try std.testing.expectEqual(g.cols * g.rows, g.cells.len); } -pub const terminal_palette = [16][3]u8{ - .{ 0x1D, 0x1F, 0x21 }, // black - .{ 0xCC, 0x66, 0x66 }, // red - .{ 0xB5, 0xBD, 0x68 }, // green - .{ 0xF0, 0xC6, 0x74 }, // yellow - .{ 0x81, 0xA2, 0xBE }, // blue - .{ 0xB2, 0x94, 0xBB }, // magenta - .{ 0x8A, 0xBE, 0xB7 }, // cyan - .{ 0xC5, 0xC8, 0xC6 }, // white - .{ 0x66, 0x66, 0x66 }, // bright black - .{ 0xD5, 0x4E, 0x53 }, // bright red - .{ 0xB9, 0xCA, 0x4A }, // bright green - .{ 0xE7, 0xC5, 0x47 }, // bright yellow - .{ 0x7A, 0xA6, 0xDA }, // bright blue - .{ 0xC3, 0x97, 0xD8 }, // bright magenta - .{ 0x70, 0xC0, 0xB1 }, // bright cyan - .{ 0xEA, 0xEA, 0xEA }, // bright white -}; - -comptime { - for (terminal_palette, 0..) |rgb, i| { - const c = ghostty_vt.color.default[i]; - if (rgb[0] != c.r or rgb[1] != c.g or rgb[2] != c.b) @compileError( - "terminal palette differs from the emulator", - ); - } -} test "a frontend draws a placement as glyph art where it shows no pixels, or where its pane asks, and else leaves the frame be" { const gpa = std.testing.allocator; |
