summaryrefslogtreecommitdiff
path: root/src/ninep
diff options
context:
space:
mode:
Diffstat (limited to 'src/ninep')
-rw-r--r--src/ninep/ctl.zig23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index 7986333c..1ac53bb7 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -3048,3 +3048,26 @@ test "a bad command inside an Edit block written whole is named, not the } after
try testing.expect(std.mem.indexOf(u8, r.reply.ename, "z") != null);
try testing.expectEqualStrings("abc\n", p.panes[0].?.file.?.content);
}
+
+test "a refused Delcol changes nothing: no pane, no focus" {
+ const p = try withFile(testing.allocator, "x\n");
+ defer p.deinit();
+ _ = wr(p, @intFromEnum(tree.TopFile.ctl), "Newcol\n");
+ const made = try th.newPane(p);
+ _ = wr(p, Node.of(made, .name), "/tmp/pardes-delcol-refused.txt\n");
+ _ = wr(p, Node.of(made, .body), "edit\n");
+ p.sync();
+ const col = layout.findPane(p, p.paneBySerial(made).?).?.col;
+ const active = p.active;
+ const active_column = p.active_column;
+ var count: usize = 0;
+ for (p.panes) |slot| count += @intFromBool(slot != null);
+ try testing.expectEqual(Status.err, wr(p, Node.ofCol(layout.columnSerial(p, col), .ctl), "Delcol\n").reply.status);
+ p.sync();
+ var after: usize = 0;
+ for (p.panes) |slot| after += @intFromBool(slot != null);
+ try testing.expectEqual(count, after);
+ try testing.expectEqual(active, p.active);
+ try testing.expectEqual(active_column, p.active_column);
+ try testing.expect(th.logHas(p, "unsaved "));
+}