cover more of the protocol

This commit is contained in:
Jeffrey C. Ollie 2024-09-29 03:46:27 -05:00
parent 63d3d9f4a8
commit e02d319b02
Signed by: jeff
GPG key ID: 6F86035A6D97044E

View file

@ -108,6 +108,7 @@ pub fn main() !void {
try kcp_writer.print("\x1b]21", .{}); try kcp_writer.print("\x1b]21", .{});
for (0..random.int(u3)) |_| { for (0..random.int(u3)) |_| {
const keys = enum { const keys = enum {
palette,
foreground, foreground,
background, background,
selection_background, selection_background,
@ -124,7 +125,11 @@ pub fn main() !void {
transparent_background_color7, transparent_background_color7,
transparent_background_color8, transparent_background_color8,
}; };
try kcp_writer.print(";{s}=", .{@tagName(random.enumValue(keys))}); const key = random.enumValue(keys);
switch (key) {
.palette => try kcp_writer.print(";{d}=", .{random.int(u8)}),
else => try kcp_writer.print(";{s}=", .{@tagName(key)}),
}
switch (random.enumValue(enum { switch (random.enumValue(enum {
color1, color1,
color2, color2,
@ -135,6 +140,7 @@ pub fn main() !void {
color7, color7,
color8, color8,
color9, color9,
color10,
query, query,
empty, empty,
})) { })) {
@ -210,6 +216,10 @@ pub fn main() !void {
random.float(f32), random.float(f32),
}, },
), ),
.color10 => try kcp_writer.print(
"rgbi:1.00/1.00/1.00",
.{},
),
.query => try kcp_writer.writeByte('?'), .query => try kcp_writer.writeByte('?'),
.empty => {}, .empty => {},
} }