diff options
Diffstat (limited to 'core/Effect.zig')
| -rw-r--r-- | core/Effect.zig | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/core/Effect.zig b/core/Effect.zig index 3bca04c9..e9f7a8f3 100644 --- a/core/Effect.zig +++ b/core/Effect.zig @@ -442,8 +442,9 @@ test "Save on an output buffer writes its rows out and leaves the buffer alone" const rows = try gpa.dupe(u8, out.file.?.content); defer gpa.free(rows); - // Save leads its tagline now, and the path is REQUIRED: a bare Save asks - try std.testing.expectEqualStrings(tagline.file_pane_tail, tagline.curTail(out)); + // Save is one of its words (`:`'s, UX K'4), and the path is REQUIRED: a + // bare Save asks + try std.testing.expectEqualStrings(tagline.file_pane_tail, tagline.kindTail(out)); try std.testing.expect(p.executeBuiltinLine(id, "Save")); try std.testing.expect(out.prompt == .save); try edit.insertKey(p.editor(), &out.input, .{ .cp = 'h', .text = "help.txt" }); @@ -626,25 +627,29 @@ test "a save whose pane is gone before the drain writes nothing" { try std.testing.expect(p.fallback.get("/tmp/pardes-gone/recycled.txt") == null); } -test "Save reaches every tagline with text behind it and no other" { +test "Save is a word of every pane with text behind it and no other" { const gpa = std.testing.allocator; const p = try Pardes.init(gpa, .{ .tty_only = true, .cols = 100, .rows = 30 }); defer p.deinit(); while (p.nextEffect()) |_| {} + // Its kind's words (what `:` lists, UX K'4); its tag's, while clean, + // Del alone (K'3). const out = try p.setTestFile("build.zig:1:1 pub fn main\n"); out.file.?.output = .{ .from = .search }; - try std.testing.expectEqualStrings(tagline.locations_pane_tail, tagline.curTail(out)); + try std.testing.expectEqualStrings(tagline.locations_pane_tail, tagline.kindTail(out)); + try std.testing.expectEqualStrings(" Del", tagline.computedWords(out)); - // A scratch is an output buffer that wears the FILE tails. + // A scratch is an output buffer that has the FILE words. out.file.?.output = .{ .from = .{ .cmd = std.meta.stringToEnum(pardes.Builtin, "New").? } }; - try std.testing.expectEqualStrings(" Save Term Collapse Follow Del", tagline.curTail(out)); + try std.testing.expectEqualStrings(" Save Term Collapse Follow Del", tagline.kindTail(out)); // An image's bytes on disk already are what they are: nothing of the // pane's own is unwritten, so the word is absent and inert. const img_id = p.freeSlot().?; const img = try pardes.Kind.open(p, img_id, pardes.Kind.test_kind.of(p), "/tmp/pardes-tag.ppm", ""); - try std.testing.expectEqualStrings(" Term Collapse Del", tagline.curTail(img)); + try std.testing.expectEqualStrings(" Del", tagline.kindTail(img)); + try std.testing.expectEqualStrings(" Del", tagline.computedWords(img)); try std.testing.expect(p.executeBuiltinLine(img_id, "Save")); try std.testing.expect(img.prompt != .save); var buf: [256]u8 = undefined; |
