summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/panes.zig24
-rw-r--r--test/pdf.zig2
2 files changed, 13 insertions, 13 deletions
diff --git a/test/panes.zig b/test/panes.zig
index 90625e81..27598334 100644
--- a/test/panes.zig
+++ b/test/panes.zig
@@ -932,7 +932,7 @@ test "paste into pane commands and prompts never inserts into the body" {
p.update(.{ .paste = " Custom\nCommand" });
try std.testing.expect(std.mem.indexOf(u8, pardes.tagline.curTail(pane), " Custom\nCommand") != null);
p.update(.{ .key = .{ .cp = Key.escape } });
- p.startPrompt(pane, &pane.body, .{ .search = config.search_marker });
+ pardes.panes.startPrompt(p, pane, &pane.body, .{ .search = config.search_marker });
p.update(.{ .paste = "t\r\nwo" });
try std.testing.expectEqualStrings(config.search_marker ++ "two", pane.promptText().?);
try std.testing.expect(std.mem.indexOf(u8, pardes.tagline.curTail(pane), " Custom\nCommand") != null);
@@ -1240,9 +1240,9 @@ test "a prompt owns the pipe behavior through cancellation and submission" {
pane.body.cur_col = 2;
pane.body.vsel = .{ .active = true, .row = 0, .col = 0, .explicit = true };
for (std.enums.values(modal.Normal.PipeBehavior)) |how| {
- p.startPrompt(pane, &pane.body, .{ .pipe = .append });
+ pardes.panes.startPrompt(p, pane, &pane.body, .{ .pipe = .append });
p.update(.{ .key = .{ .cp = Key.escape } });
- p.startPrompt(pane, &pane.body, .{ .pipe = how });
+ pardes.panes.startPrompt(p, pane, &pane.body, .{ .pipe = how });
try std.testing.expectEqual(how, pane.prompt.pipe);
p.update(.{ .key = .{ .cp = 'c', .text = "cat" } });
p.update(.{ .key = .{ .cp = Key.enter } });
@@ -1260,19 +1260,19 @@ test "a prompt owns the pipe behavior through cancellation and submission" {
}
test "a prompt that cannot be opened leaves the open one as it was" {
- const Request = @typeInfo(@TypeOf(Pardes.startPrompt)).@"fn".param_types[3].?;
+ const Request = @typeInfo(@TypeOf(pardes.panes.startPrompt)).@"fn".param_types[3].?;
for ([_]Request{ .{ .search = config.search_marker }, .save, .{ .pipe = .replace }, .{ .pipe = .ignore }, .{ .pipe = .insert }, .{ .pipe = .append } }) |request| {
var failing = std.testing.FailingAllocator.init(std.testing.allocator, .{});
const p = try Pardes.init(failing.allocator(), .{ .tty_only = true });
defer p.deinit();
const pane = try p.setTestFile("one\n");
- p.startPrompt(pane, &pane.body, .{ .search = config.search_marker });
+ pardes.panes.startPrompt(p, pane, &pane.body, .{ .search = config.search_marker });
p.update(.{ .key = .{ .cp = 'p', .text = "prior" } });
pane.body.normal = .{ .count = 9, .prefix = .goto_prefix };
const previous_normal = pane.body.normal;
_ = p.scratch.reset(.free_all);
failing.fail_index = failing.alloc_index;
- p.startPrompt(pane, &pane.body, request);
+ pardes.panes.startPrompt(p, pane, &pane.body, request);
try std.testing.expect(failing.has_induced_failure);
try std.testing.expect(pane.prompt == .search);
try std.testing.expectEqualStrings(config.search_marker ++ "prior", pane.promptText().?);
@@ -1290,7 +1290,7 @@ test "Save's prompt starts from an owned directory ending in a slash, or none" {
for ([_][]const u8{ "/dír space/", "" }) |dir| {
try pane.setOwnedCwd(dir);
const slash = if (dir.len == 0 or dir[dir.len - 1] != '/') "/" else "";
- p.startPrompt(pane, &pane.body, .save);
+ pardes.panes.startPrompt(p, pane, &pane.body, .save);
try std.testing.expect(pane.prompt == .save);
const answer = pane.promptText().?;
try std.testing.expect(std.mem.startsWith(u8, answer, config.save_marker));
@@ -1301,7 +1301,7 @@ test "Save's prompt starts from an owned directory ending in a slash, or none" {
}
test "a prompt opens with one allocation" {
- const Request = @typeInfo(@TypeOf(Pardes.startPrompt)).@"fn".param_types[3].?;
+ const Request = @typeInfo(@TypeOf(pardes.panes.startPrompt)).@"fn".param_types[3].?;
for ([_]Request{ .{ .search = config.search_marker }, .save, .{ .pipe = .replace }, .{ .pipe = .ignore }, .{ .pipe = .insert }, .{ .pipe = .append } }) |request| {
var failing = std.testing.FailingAllocator.init(std.testing.allocator, .{});
const p = try Pardes.init(failing.allocator(), .{ .tty_only = true });
@@ -1309,7 +1309,7 @@ test "a prompt opens with one allocation" {
const pane = try p.setTestFile("one\n");
_ = p.scratch.reset(.free_all);
const before = failing.alloc_index;
- p.startPrompt(pane, &pane.body, request);
+ pardes.panes.startPrompt(p, pane, &pane.body, request);
try std.testing.expectEqual(before + 1, failing.alloc_index);
try std.testing.expect(pane.focus == .body and pane.input.mode == .insert);
}
@@ -1334,7 +1334,7 @@ test "file history construction failures preserve existing panes" {
const result = switch (case) {
.open => panes.File.open(p, p.freeSlot().?, path, 0),
.output => panes.Output.open(p, p.freeSlot().?, "/", .{ .cmd = .Help }, "", incoming.?),
- .tutor => p.openTutorView(1),
+ .tutor => pardes.panes.openTutorView(p, 1),
.replace => p.setTestFile("replacement\n"),
};
if (result) |pane| {
@@ -1437,7 +1437,7 @@ test "Save rearms renamed file watches only after a successful write" {
replacement.file.?.saved_revision -%= 1;
},
.closed => {
- h.core.deinitPane(h.core.panes[id].?) catch |err| {
+ pardes.panes.deinitPane(h.core, h.core.panes[id].?) catch |err| {
h.err = err;
return;
};
@@ -1603,7 +1603,7 @@ test "removed and recycled pane slots have no stale geometry" {
layout.compute(p);
try std.testing.expectEqual(pardes.Rect{}, p.rects[id]);
- try p.deinitPane(original);
+ try pardes.panes.deinitPane(p, original);
p.panes[id] = null;
p.rects[id] = .{ .x = 10, .y = 5, .w = 20, .h = 10 };
const replacement = try p.newDocPane(id);
diff --git a/test/pdf.zig b/test/pdf.zig
index 722e28b4..730bf2ce 100644
--- a/test/pdf.zig
+++ b/test/pdf.zig
@@ -468,7 +468,7 @@ test "watched PDF reload replaces MuPDF state and preserves the reading view" {
// The watch follows the PDF payload's lifetime just like a text file's;
// emit the stop while the slot still identifies the disappearing pane.
- try p.deinitPane(pane);
+ try pardes.panes.deinitPane(p, pane);
p.panes[0] = null;
var unwatched = false;
while (p.nextEffect()) |effect| switch (effect) {