diff options
Diffstat (limited to 'core/ninep/ctl.zig')
| -rw-r--r-- | core/ninep/ctl.zig | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/ninep/ctl.zig b/core/ninep/ctl.zig index 84f3ba6b..637999c2 100644 --- a/core/ninep/ctl.zig +++ b/core/ninep/ctl.zig @@ -1747,6 +1747,8 @@ test "a look whose pane is refused a place fails with that alone, not a missing // A screen with rows for one pane only. const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 80, .rows = 5 }); defer p.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + p.settings.jumps = .@"new-pane"; while (p.nextEffect()) |_| {} _ = try p.setTestFile("x\n"); while (p.nextEffect()) |_| {} @@ -2055,7 +2057,7 @@ test "a language server question that finds nothing, cannot be answered, or is a _ = wr(p, root_exec, "Recent\n"); const listed = p.paneBySerial(try std.fmt.parseInt(u32, std.mem.trimEnd(u8, rd(p, root_exec, 0, 64).bytes, "\n"), 10)).?; p.lspRequest(listed, .incoming_calls, ""); - try testing.expect(std.mem.indexOf(u8, p.panes[listed].?.msg[0..p.panes[listed].?.msg_len], "Callers: only a file's pane asks") != null); + try testing.expect(std.mem.indexOf(u8, p.messages.saidBy(p.panes[listed].?), "Callers: only a file's pane asks") != null); // Nothing found: Callers says so, and the waiting write hears it. p.fs.late_failure_len = 0; p.lspRequest(id, .incoming_calls, ""); @@ -2126,6 +2128,8 @@ test "with no pane at all, the root look opens its file and the root exec runs i if (pardes.Term.ops == null) return error.SkipZigTest; // a command pane const p = try withFile(testing.allocator, "x\n"); defer p.deinit(); + // About a jump opening a pane: `Jumps new-pane` (SPEC §6.6). + p.settings.jumps = .@"new-pane"; var tmp = testing.tmpDir(.{}); defer tmp.cleanup(); try tmp.dir.writeFile(testing.io, .{ .sub_path = "f.txt", .data = "file\n" }); @@ -2264,7 +2268,7 @@ test "a column takes panes until their documented minimums fill it, not until no const new = @backingInt(tree.TopFile.new); while (call(p, .{ .tag = 1, .op = .open, .node = new }).reply.status == .ok) p.sync(); p.sync(); - const avail = p.view().screen_h - (p.topBarHeight() + layout.columnBarHeight(p)); + const avail = p.view().screen_h - (p.topBarHeight() + layout.columnBarHeight(p) + layout.noticeRowHeight(p)); for (0..p.view().ncol) |c| { var need: u32 = 0; for (p.view().cols[c].panes[0..p.view().cols[c].n]) |k| need += layout.minRows(p, k); @@ -2388,7 +2392,9 @@ test "a file changed on disk under unsaved edits is not reloaded: it says so, ge pardes.panes.File.changed(p, 0, "three\n"); try testing.expectEqualStrings("two\nmine\n", f.content); try testing.expect(f.revision != f.saved_revision); - try testing.expect(th.logHas(p, "changed on disk (get reloads it, Save overwrites it)")); + // ...and asks, in its tag (Messages.waiting), which /log hears. + try testing.expect(p.messages.waiting(p.panes[0].?) != null); + try testing.expect(th.logHas(p, "changed on disk\n")); var want: [32]u8 = undefined; try testing.expect(th.logHas(p, try std.fmt.bufPrint(&want, "changed {d}\n", .{serial}))); // Exit and get still ask about the edits. |
