diff options
Diffstat (limited to 'test/behaviour/root_ctl.zig')
| -rw-r--r-- | test/behaviour/root_ctl.zig | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/behaviour/root_ctl.zig b/test/behaviour/root_ctl.zig index 3e546237..12f2b56a 100644 --- a/test/behaviour/root_ctl.zig +++ b/test/behaviour/root_ctl.zig @@ -123,3 +123,21 @@ fn lastIncl(s: *Session) ![]const u8 { const at = std.mem.indexOf(u8, log, "\nmsg - Incl:") orelse return error.NoIncl; return log[at .. std.mem.indexOfScalarPos(u8, log, at + 1, '\n').? + 1]; } + +test "root-ctl: Joincol with no column to the right and Theme with no such theme say so; a theme's name is any case" { + var s = try Session.initFile(std.testing.allocator, "x\n"); + defer s.deinit(); + try std.testing.expect(try s.refused("/ctl", "Joincol\n") != 0); + try std.testing.expect(std.mem.startsWith(u8, s.said, "Joincol: no column to the right")); + try std.testing.expectEqual(@as(u16, 22), try s.refused("/ctl", "Theme drak\n")); + try std.testing.expect(std.mem.startsWith(u8, s.said, "bad value in control message; like it: ")); + try std.testing.expect(has(s.said, ": dr")); + try std.testing.expect(std.mem.endsWith(u8, s.said, "\"drak\"")); + // Within the 128 bytes an Rerror carries, the quoted line kept. + try std.testing.expect(s.said.len <= 128); + // A click on the word says it in the log. + _ = try s.refused(s.at("/pane/{d}/exec", .{try s.focused()}), "Theme drak\n"); + try std.testing.expect(has(try s.read("/log"), "no theme \"drak\"")); + try s.write("/ctl", "Theme DRACULA\n"); + try std.testing.expect(has(try s.read("/ctl"), "\nTheme dracula\n")); +} |
