summaryrefslogtreecommitdiff
path: root/test/terminal.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-26 10:19:20 -0300
committerGabriel Schneider <[email protected]>2026-11-26 11:28:39 -0300
commitadd0837dc1927389096cbaaf65b7e1a42028eafc (patch)
treecdf3252f64669691dd4d5338fc2019390d6d8131 /test/terminal.zig
parent7d0aaa0c1e68127c023358698498eaeffe57401b (diff)
downloadpardes-add0837dc1927389096cbaaf65b7e1a42028eafc.tar.gz
pardes-add0837dc1927389096cbaaf65b7e1a42028eafc.zip
colors, Core, Kind, lib: the old views deleted, now that no surface reads them (DESIGN.md B6, B8): `ChromeTheme` (its old fields, `view` and `resolved`) and the old names' view of every theme (`viewOf`, theme_schema's `toLegacy` and `Derived`), `readingOf` (the reading tint, gone with G1'), `separatorOf`, `focusTint`/`focusTintFloor` and their floors, `lerp`, the sRGB `mix`, and `Grounds` (the library's diff grounds: `Chrome`'s `add` and `del` say them; lib_syntax exports `Chrome` in its place); `Pardes.theme()` is the theme worn in the new names (`*const Theme`: a picker's preview, a theme file's, or the session's), read for its name; `chromeTheme()` is gone and `chrome()` is the one accessor (the session's chrome or a preview's, each a `Chrome` worked out at a theme change); a theme file is kept as the `Theme` it loads to (`custom_theme`), its old names read by the load-time loader, which STAYS (`LegacyTheme` and `Theme.fromLegacy`: the user's own one_dark_zed_mod.zon and an older DumpThemes' output load as before); Kind's page, ink, selection and link for a picture's or a PDF's raster from the chrome (R1: the page, never the tag, as a theme's page where it has none: dark's `null_page`; the link the page's key ink), the macOS shell's rules and page from the chrome and the theme's `page`; the source test (body_layer.zig's: no `theme()` read but its name, no `chromeTheme()`, `.roles`, `Grounds` or `LegacyTheme`) covers draw.zig, tagline.zig, Band.zig, Messages.zig and Kind.zig too, so a surface deriving its own colour cannot be written there (B6's bar); THE TESTS: the tests of the old derivations go with them, each held by the ring test on the chrome (every native's separators and focus tint, every faithful port's own chrome, a legacy document's derived roles, the old active name-tint precedence), and the rest read the new names and the chrome (a theme's own rule kept, the natives' text and UI roles on their own surfaces, their dark palettes, the quiet line numbers through a theme file, the column grips, the ThemeFile load and its old-names loader, Core's, Command's, panes', terminal's, output's and file_watch's theme reads, the library consumer's diff grounds through `Chrome`); RUN: the build is the test of a deletion (no reader left), the suites below; GOLDENS: none moved; GATES on this change, the stack's top (tui): core-test 1158/1332 (174 skipped: the 4 tests of the old derivations gone; the importer's 7 counted again after a cache wipe), shell-test 1373/1376 (3 skipped), pane-test 184/185 (1 skipped), behaviour-test 287/287 and --replay 20 seeds of 70 steps, 0 failures, process-test 0 of 149 failed (3 skipped; 0 of 103 moved with --update), term-test 17/17, kitty-test 45/45; gui unit-test 1984/1988 (4 skipped; its one failure the known BaselineHarnessMismatch; test/consumer's diff grounds through `Chrome` pass); the ring 245 of 245; the dump fuzz at 40,000 join seeds twice and 1,779 image seeds 11/11 (custom_theme, a digested field, is a Theme now); the soak (replicas, 5 clients, rtt 30,80,207): diverged 0, unequal 0, quiet checks 365/0 451/0 622/0, unlisted stops 0, the corpus 22 of 22 scenes the same, no leak; load 1.3 to 15.6 (other agents' builds); OUTSIDE the L2a files: core/colors.zig, core/Core.zig, core/root.zig, core/theme_schema.zig, core/lib_syntax.zig, core/syntax.zig (a doc line), core/Kind.zig (two hunks), core/File.zig (a test line), core/body_layer.zig (the source test's list), runtime/macos.zig (three lines), dev/file_watch.zig, test/consumer/lib.zig, test/panes.zig, test/terminal.zig, test/output.zig, core/Command.zig (tests)
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBFhdevVu48bvL9kCE
Diffstat (limited to 'test/terminal.zig')
-rw-r--r--test/terminal.zig26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/terminal.zig b/test/terminal.zig
index 1168fac7..3c74cd11 100644
--- a/test/terminal.zig
+++ b/test/terminal.zig
@@ -393,14 +393,14 @@ test "terminal Filter keys indexed truecolor OSC and background-only cells throu
p.update(.{ .output = .{ .pane = .at(0), .bytes = "\x1b]104;1\x1b\\" } });
var custom = p.theme().*;
custom.name = try p.gpa.dupe(u8, "same-name");
- custom.palette = pardes.colors.xterm[0..16].*;
- custom.palette.?[1] = .{ 1, 2, 3 };
+ custom.ansi = pardes.colors.xterm[0..16].*;
+ custom.ansi.?[1] = .{ 1, 2, 3 };
p.custom_theme = custom;
pardes.colors.finishThemeInitialization(p);
_ = frame.reset(.retain_capacity);
const custom_first = try p.render(frame.allocator());
try testing.expectEqual(plain.Color{ .rgb = .{ 1, 2, 3 } }, custom_first.at(tx, body_y).style.fg);
- if (p.custom_theme) |*theme| theme.palette.?[1] = .{ 4, 5, 6 };
+ if (p.custom_theme) |*theme| theme.ansi.?[1] = .{ 4, 5, 6 };
pardes.colors.finishThemeInitialization(p);
_ = frame.reset(.retain_capacity);
const custom_second = try p.render(frame.allocator());
@@ -465,9 +465,9 @@ test "terminal Filter preserves exact palette-null light theme default roles" {
var light = p.theme().*;
light.name = try p.gpa.dupe(u8, "filter-light-defaults");
- light.bg = .{ 0xf8, 0xf8, 0xf8 };
- light.fg = .{ 0x38, 0x38, 0x38 };
- light.palette = null;
+ light.page = .{ 0xf8, 0xf8, 0xf8 };
+ light.text = .{ 0x38, 0x38, 0x38 };
+ light.ansi = null;
p.custom_theme = light;
pardes.colors.finishThemeInitialization(p);
@@ -482,14 +482,14 @@ test "terminal Filter preserves exact palette-null light theme default roles" {
const tx = r.x + config.GUTTER;
const body_y = p.bodyTop(pane, r);
const ordinary = try p.render(frame.allocator());
- try testing.expectEqual(plain.Color{ .rgb = light.fg.? }, ordinary.at(tx, body_y).style.fg);
- try testing.expectEqual(plain.Color{ .rgb = light.bg.? }, ordinary.at(tx, body_y).style.bg);
+ try testing.expectEqual(plain.Color{ .rgb = light.text.? }, ordinary.at(tx, body_y).style.fg);
+ try testing.expectEqual(plain.Color{ .rgb = light.page.? }, ordinary.at(tx, body_y).style.bg);
p.update(.{ .output = .{ .pane = .at(0), .bytes = "\x1b[?5h" } });
_ = frame.reset(.retain_capacity);
const reversed = try p.render(frame.allocator());
- try testing.expectEqual(plain.Color{ .rgb = light.bg.? }, reversed.at(tx, body_y).style.fg);
- try testing.expectEqual(plain.Color{ .rgb = light.fg.? }, reversed.at(tx, body_y).style.bg);
+ try testing.expectEqual(plain.Color{ .rgb = light.page.? }, reversed.at(tx, body_y).style.fg);
+ try testing.expectEqual(plain.Color{ .rgb = light.text.? }, reversed.at(tx, body_y).style.bg);
}
test "terminal Filter maps the default roles before it maps anything else" {
@@ -631,8 +631,8 @@ test "tty ansi colors follow the prompt hug into normal mode" {
const r = p.view().rects[0];
const tx = r.x + config.GUTTER;
const body_y = p.bodyTop(pane, r);
- const red: plain.Color = .{ .rgb = p.theme().palette.?[1] };
- const blue: plain.Color = .{ .rgb = p.theme().palette.?[4] };
+ const red: plain.Color = .{ .rgb = p.theme().ansi.?[1] };
+ const blue: plain.Color = .{ .rgb = p.theme().ansi.?[4] };
// tty mode projects the emulator's ansi colours cell for cell.
pane.body.mode = .tty;
@@ -672,7 +672,7 @@ test "a prompt row hidden end to end paints nothing at all" {
const s = try p.render(frame.allocator());
try testing.expectEqualStrings(" ", s.at(tx, body_y).grapheme());
- try testing.expect(!std.meta.eql(plain.Color{ .rgb = p.theme().palette.?[1] }, s.at(tx, body_y).style.bg));
+ try testing.expect(!std.meta.eql(plain.Color{ .rgb = p.theme().ansi.?[1] }, s.at(tx, body_y).style.bg));
}
test "a program that asked for focus reports hears CSI I and CSI O as its pane takes and gives up the keyboard, and as the window does" {