diff options
Diffstat (limited to 'test/terminal.zig')
| -rw-r--r-- | test/terminal.zig | 26 |
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" { |
