summaryrefslogtreecommitdiff
path: root/core/colors.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/colors.zig')
-rw-r--r--core/colors.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/colors.zig b/core/colors.zig
index 5579ed05..e239d717 100644
--- a/core/colors.zig
+++ b/core/colors.zig
@@ -955,7 +955,7 @@ test "a theme file that cannot be read is named in the failure" {
requestThemeFile(p, 0, "/nowhere/mine.zon");
failThemeFile(p, p.theme_file_generation, error.FileNotFound);
const pane = p.panes[0].?;
- try std.testing.expect(std.mem.indexOf(u8, pane.msg[0..pane.msg_len], "theme file /nowhere/mine.zon: ") != null);
+ try std.testing.expect(std.mem.indexOf(u8, p.messages.saidBy(pane), "theme file /nowhere/mine.zon: ") != null);
}
test "a theme file nested 10, 1 000 and 100 000 deep is refused in words, never a stack overflow" {
@@ -971,11 +971,11 @@ test "a theme file nested 10, 1 000 and 100 000 deep is refused in words, never
try source.appendSlice(gpa, "1");
for (0..depth) |_| try source.append(gpa, '}');
try source.appendSlice(gpa, " }\n");
- p.panes[0].?.msg_len = 0;
+ p.messages.live_len = 0;
// Up to 2026-11-23 std's parser took it: 5 000 deep overflowed the
// stack (a Debug build's 16 MiB).
try std.testing.expect(!loadThemeFile(p, p.theme_file_generation, source.items));
- const said = p.panes[0].?.msg[0..p.panes[0].?.msg_len];
+ const said = p.messages.saidBy(p.panes[0].?);
std.testing.expect(std.mem.indexOf(u8, said, "theme file /tmp/pardes-config/themes/deep.zon: ") != null) catch |err| {
std.debug.print("{d} deep: said {s}\n", .{ depth, said });
return err;
@@ -1016,7 +1016,7 @@ test "ThemeFile parses ZON atomically and Theme returns to the compiled ring" {
// A half-written save is rejected without disturbing the last good value.
try std.testing.expect(!loadThemeFile(p, request_effect.generation, ".{ .name = "));
// Said with its line, in words: never a bare `parse zon`.
- const said = p.panes[0].?.msg[0..p.panes[0].?.msg_len];
+ const said = p.messages.saidBy(p.panes[0].?);
try std.testing.expect(std.mem.indexOf(u8, said, ": line 1: ") != null and std.mem.indexOf(u8, said, "parse zon") == null);
try std.testing.expectEqualStrings("mine", p.theme().name);
try std.testing.expectEqual(@as(?[3]u8, .{ 1, 2, 3 }), p.theme().bg);