summaryrefslogtreecommitdiff
path: root/test/output.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-05 22:40:49 -0300
committerGabriel Schneider <[email protected]>2026-11-05 23:58:31 -0300
commitdfcc040ac979b695dc2e68b9d866c2769ba6d928 (patch)
treecd88c998b46f758a7c74e3d800312d968d6303ac /test/output.zig
parentf930d53c58187381b2f0df6892546ac1c217c9db (diff)
downloadpardes-dfcc040ac979b695dc2e68b9d866c2769ba6d928.tar.gz
pardes-dfcc040ac979b695dc2e68b9d866c2769ba6d928.zip
settings #2, five presentation variants go, each now the style it had by default: Colors (text panes and terminals coloured, with SPC t c), TreeContextTagStyle (TreeContext rows in the tag's style), FocusTint (the focused tags tinted), SyntaxBold (keywords not bold) and Ligatures (the window shapes them; gui.zig's syncLigatures and the words' ligatures flag go, and Capabilities.ligatures); the reads deleted are in File.zig, body_layer.zig, Tables.zig, exec.zig's applySettingBuiltin, Core.zig (SessionView.layered left at its default), draw.zig, surface.zig's comment and gui.zig; deleted tests: "settings: Colors off draws a source plain, and on again colours its keywords", "Ligatures is a setting only in the shell that shapes text" and "Ligatures off draws a ligature as its cells' own glyphs, and on shapes it again", and the toggled half of TreeContext's Core test; rewritten through what stays: SyntaxBold's every-row test as keywords coloured in every row, the tag-click tests on JumpTrail, the tag-name tint tests with the focused tag's ink plain, Core's tab test by the keyword's ink; golden changes, each the cut's: syntax, theme, mini and ninep lose their Colors toggles and frames (the message row after them names the builtin before, Mini), and leader, ttyhelp and builtins' Help listing is four columns narrower, TreeContextTagStyle having been its longest word; perf.zig's harness id moves again; the window scenes from 09 on take new gui-goldens lines, the scene no longer writing FocusTint on and its word gone from the message row (the base window build running the same scenes gives the same frames); gates on tui: core-test 965/965, behaviour-test 242/242, unit-test 1482/1483, pane-test 171/172, snap all 105 scripts ok, process-test 0 of 37 failed; gui unit-test 1526/1527, gui-golden 0 of 1 failed
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'test/output.zig')
-rw-r--r--test/output.zig24
1 files changed, 9 insertions, 15 deletions
diff --git a/test/output.zig b/test/output.zig
index 70518de8..7fb9f237 100644
--- a/test/output.zig
+++ b/test/output.zig
@@ -38,16 +38,13 @@ test "search tint survives wrapping and theme changes while selections remain au
pane.file.?.output = .{ .from = .search };
var frame = std.heap.ArenaAllocator.init(std.testing.allocator);
defer frame.deinit();
- for ([_]bool{ true, false, true }) |colors| {
- p.settings.colors = colors;
- const surface = try p.render(frame.allocator());
- var marked: usize = 0;
- for (surface.cells) |cell| {
- if (std.meta.eql(cell.style.bg, pardes.Color{ .rgb = p.theme().search_bg.? })) marked += 1;
- }
- try std.testing.expectEqual(@as(usize, if (colors) 3 else 0), marked);
- _ = frame.reset(.retain_capacity);
+ const surface = try p.render(frame.allocator());
+ var marked: usize = 0;
+ for (surface.cells) |cell| {
+ if (std.meta.eql(cell.style.bg, pardes.Color{ .rgb = p.theme().search_bg.? })) marked += 1;
}
+ try std.testing.expectEqual(@as(usize, 3), marked);
+ _ = frame.reset(.retain_capacity);
// The body changes immediately even when dark chrome is still fading.
try std.testing.expect(p.executeBuiltinLine(0, "Theme daybreak"));
const light = try p.render(frame.allocator());
@@ -430,7 +427,7 @@ test "Mini dump preserves its exact virtual snapshot and body writes detach colo
try std.testing.expect(mini.file.?.mini == null);
}
-test "Mini syntax colors survive toggles themes and rendering without source access" {
+test "Mini syntax colors survive themes and rendering without source access" {
if (!pardes.syntax.enabled) return error.SkipZigTest;
var tmp = std.testing.tmpDir(.{});
defer tmp.cleanup();
@@ -440,7 +437,6 @@ test "Mini syntax colors survive toggles themes and rendering without source acc
const p = try Pardes.init(std.testing.allocator, .{ .tty_only = true, .cols = 80, .rows = 24 });
defer p.deinit();
try p.panes[0].?.setOwnedCwd(dir);
- p.settings.colors = false;
try panes.mini.open(p, 0, "demo.zig");
const id = p.active;
const mini = p.panes[id].?;
@@ -453,14 +449,13 @@ test "Mini syntax colors survive toggles themes and rendering without source acc
const colors = mini.file.?.mini.?.colors.ptr;
var frame = std.heap.ArenaAllocator.init(std.testing.allocator);
defer frame.deinit();
- for ([_]bool{ false, true, false, true }) |enabled| {
- p.settings.colors = enabled;
+ for (0..4) |_| {
mini.file.?.syntax_dirty = true;
const surface = try p.render(frame.allocator());
const rect = p.rects[id];
const x = rect.x + config.GUTTER + panes.File.gutterWidth(mini) + @as(u16, @intCast(column));
const y = p.bodyTop(mini, rect) + @as(u16, @intCast(position.row));
- if (enabled) try std.testing.expectEqualDeep(pardes.Color{ .rgb = p.theme().kw }, surface.at(x, y).style.fg);
+ try std.testing.expectEqualDeep(pardes.Color{ .rgb = p.theme().kw }, surface.at(x, y).style.fg);
try std.testing.expectEqual(colors, mini.file.?.mini.?.colors.ptr);
try std.testing.expectEqual(@as(usize, 0), mini.file.?.highlights.len);
_ = frame.reset(.retain_capacity);
@@ -776,7 +771,6 @@ test "identical result refresh keeps warm content caches without allocation" {
defer p.deinit();
p.locations_config.layout = .@"inline";
const source = try p.setTestFile("notes\n");
- p.settings.colors = true;
const text = "a.zig:1:1 pub fn first() void {}\na.zig:2:1 if (true) return;\n";
try panes.Output.fillResults(p, 0, "/tmp", .{ .query = .references }, "before", try p.gpa.dupe(u8, text), 0);
const id = source.search_pane orelse return error.MissingResults;