summaryrefslogtreecommitdiff
path: root/test/behaviour/limits.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/behaviour/limits.zig')
-rw-r--r--test/behaviour/limits.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/behaviour/limits.zig b/test/behaviour/limits.zig
index d84d4490..35dde65e 100644
--- a/test/behaviour/limits.zig
+++ b/test/behaviour/limits.zig
@@ -38,3 +38,14 @@ test "limits: a ctl line over 1 MiB is refused once, EINVAL, and its tail is not
// What came after the long line's newline ran.
try s.expect(s.at("/pane/{d}/body", .{n}), "");
}
+
+test "limits: a ctl line with no newline is held whatever its write's size, and runs at the close, its failure in the log" {
+ var s = try Session.initFile(std.testing.allocator, "x\n");
+ defer s.deinit();
+ const ctl = try s.hold(s.at("/pane/{d}/ctl", .{try s.focused()}), 1);
+ const line = "bogus" ++ @as([20000]u8, @splat('x'));
+ try std.testing.expectEqual(@as(u16, 0), try s.writeFid(ctl, line));
+ try std.testing.expect(std.mem.indexOf(u8, try s.read("/log"), "ctl: unknown control message") == null);
+ s.clunk(ctl);
+ try std.testing.expect(std.mem.indexOf(u8, try s.read("/log"), "ctl: unknown control message") != null);
+}