summaryrefslogtreecommitdiff
path: root/test/output.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/output.zig')
-rw-r--r--test/output.zig24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/output.zig b/test/output.zig
index 77de7649..f2a35c01 100644
--- a/test/output.zig
+++ b/test/output.zig
@@ -41,7 +41,7 @@ test "search tint survives wrapping and theme changes while selections remain au
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;
+ if (std.meta.eql(cell.style.bg, pardes.Color{ .rgb = p.chrome().hit })) marked += 1;
}
try std.testing.expectEqual(@as(usize, 3), marked);
_ = frame.reset(.retain_capacity);
@@ -50,8 +50,8 @@ test "search tint survives wrapping and theme changes while selections remain au
const light = try p.render(frame.allocator());
var light_matches: usize = 0;
for (light.cells) |cell| {
- if (!std.meta.eql(cell.style.bg, pardes.Color{ .rgb = p.theme().search_bg.? })) continue;
- try std.testing.expectEqualDeep(pardes.Color{ .rgb = p.theme().search_fg.? }, cell.style.fg);
+ if (!std.meta.eql(cell.style.bg, pardes.Color{ .rgb = p.chrome().hit })) continue;
+ try std.testing.expectEqualDeep(pardes.Color{ .rgb = p.chrome().page.text }, cell.style.fg);
light_matches += 1;
}
try std.testing.expectEqual(@as(usize, 3), light_matches);
@@ -61,7 +61,7 @@ test "search tint survives wrapping and theme changes while selections remain au
pane.body.vsel = .{ .active = true, .row = 0, .col = pane.body.cur_col - 2, .explicit = true };
const selected = try p.render(frame.allocator());
for (selected.cells) |cell|
- try std.testing.expect(!std.meta.eql(cell.style.bg, pardes.Color{ .rgb = p.theme().search_bg.? }));
+ try std.testing.expect(!std.meta.eql(cell.style.bg, pardes.Color{ .rgb = p.chrome().hit }));
try std.testing.expectEqualStrings(text, pane.file.?.content);
}
}
@@ -128,15 +128,15 @@ test "location producers retain rendered location match and diagnostic styles" {
var frame = std.heap.ArenaAllocator.init(p.gpa);
defer frame.deinit();
const surface = try p.render(frame.allocator());
- const chrome = pardes.ChromeTheme.fromTheme(p.theme());
- try std.testing.expectEqual(pardes.Color{ .rgb = chrome.lineno }, outputCell(p, surface, id, 0).style.fg);
+ const chrome = p.chrome();
+ try std.testing.expectEqual(pardes.Color{ .rgb = chrome.line_number }, outputCell(p, surface, id, 0).style.fg);
const start = file.location_rows[0].code_start;
const first = outputCell(p, surface, id, start);
if (diagnostic) {
- try std.testing.expectEqual(pardes.Color{ .rgb = chrome.diagnostic_warning }, first.style.fg);
+ try std.testing.expectEqual(pardes.Color{ .rgb = chrome.page.severity[1] }, first.style.fg);
try std.testing.expect(first.style.bold);
} else if (origin == .search or origin == .cmd) {
- try std.testing.expectEqual(pardes.Color{ .rgb = chrome.search_bg }, first.style.bg);
+ try std.testing.expectEqual(pardes.Color{ .rgb = chrome.hit }, first.style.bg);
}
if (!diagnostic) {
const number = start + std.mem.indexOf(u8, code, "42").?;
@@ -1145,10 +1145,10 @@ test "LSP occurrence tint follows the supplied source span through context" {
var frame = std.heap.ArenaAllocator.init(p.gpa);
defer frame.deinit();
const surface = try p.render(frame.allocator());
- const chrome = pardes.ChromeTheme.fromTheme(p.theme());
+ const chrome = p.chrome();
var marked: usize = 0;
for (surface.cells) |cell| {
- if (!std.meta.eql(cell.style.bg, pardes.Color{ .rgb = chrome.search_bg })) continue;
+ if (!std.meta.eql(cell.style.bg, pardes.Color{ .rgb = chrome.hit })) continue;
try std.testing.expect(cell.text[0] == 'f' or cell.text[0] == 'o');
marked += 1;
}
@@ -1294,10 +1294,10 @@ test "stacked search and LSP results retain source tint navigation and dump owne
var arena = std.heap.ArenaAllocator.init(p.gpa);
defer arena.deinit();
const surface = try p.render(arena.allocator());
- const chrome = pardes.ChromeTheme.fromTheme(p.theme());
+ const chrome = p.chrome();
var marked: usize = 0;
for (surface.cells) |cell| {
- if (!std.meta.eql(cell.style.bg, pardes.Color{ .rgb = chrome.search_bg })) continue;
+ if (!std.meta.eql(cell.style.bg, pardes.Color{ .rgb = chrome.hit })) continue;
try std.testing.expect(cell.text[0] == 'f' or cell.text[0] == 'o');
marked += 1;
}