summaryrefslogtreecommitdiff
path: root/test/behaviour/edit.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/behaviour/edit.zig')
-rw-r--r--test/behaviour/edit.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/behaviour/edit.zig b/test/behaviour/edit.zig
index e95471c6..3d1a731e 100644
--- a/test/behaviour/edit.zig
+++ b/test/behaviour/edit.zig
@@ -19,3 +19,13 @@ test "edit: a write of an Edit block carries it whole, to a pane's ctl, the root
try s.expect(body, "<foo] x\n<foo] y\nend\n");
try std.testing.expect(std.mem.indexOf(u8, try s.read("/log"), "unmatched") != null);
}
+
+test "edit: a bad command inside an Edit block written whole is named, not the } after it" {
+ var s = try Session.initFile(std.testing.allocator, "abc\n");
+ defer s.deinit();
+ const n = try s.focused();
+ try std.testing.expect(try s.refused(s.at("/pane/{d}/ctl", .{n}), "Edit {\n,s/a/b/\nzq\n}\n") != 0);
+ try std.testing.expect(std.mem.indexOf(u8, s.said, "\"}\"") == null);
+ try std.testing.expect(std.mem.indexOf(u8, s.said, "z") != null);
+ try s.expect(s.at("/pane/{d}/body", .{n}), "abc\n");
+}