summaryrefslogtreecommitdiff
path: root/core/Pipe.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Pipe.zig')
-rw-r--r--core/Pipe.zig13
1 files changed, 7 insertions, 6 deletions
diff --git a/core/Pipe.zig b/core/Pipe.zig
index 1ef2e4ea..e94d2099 100644
--- a/core/Pipe.zig
+++ b/core/Pipe.zig
@@ -480,8 +480,9 @@ test "| in a tag pipes the tag's own text, and undo there brings it back" {
defer p.deinit();
while (p.nextEffect()) |_| {}
const pane = try p.setTestFile("body\n");
- for ("::") |c| p.update(.{ .key = .{ .cp = c } }); // the tag (`:` on the empty `:` field), on Save
- p.update(.{ .key = .{ .cp = 'e' } }); // Save selected
+ pane.tag.own = try gpa.dupe(u8, "Look here"); // the user's text (UX K'1)
+ for ("::") |c| p.update(.{ .key = .{ .cp = c } }); // the tag (`:` on the empty `:` field), on its own text
+ p.update(.{ .key = .{ .cp = 'e' } }); // Look selected
p.update(.{ .key = .{ .cp = '|' } });
try std.testing.expect(pane.focus == .tag and pane.prompt == .pipe and pane.prompt_for == .tag);
p.update(.{ .key = .{ .cp = 't', .text = "tr a-z A-Z" } });
@@ -490,13 +491,13 @@ test "| in a tag pipes the tag's own text, and undo there brings it back" {
const id = nextPipeEffect(p) orelse return error.MissingPipeEffect;
const request = p.pipe.pipeRequest(id) orelse return error.MissingPipeRequest;
try std.testing.expectEqual(@as(usize, 1), request.inputs.len);
- try std.testing.expectEqualSlices(u8, "Save", request.inputs[0]);
- const outputs: []const []const u8 = &.{"SAVE"};
+ try std.testing.expectEqualSlices(u8, "Look", request.inputs[0]);
+ const outputs: []const []const u8 = &.{"LOOK"};
p.update(.{ .pipe_resp = .{ .id = id, .success = true, .outputs = outputs } });
- try std.testing.expect(std.mem.startsWith(u8, pardes.tagline.curTail(pane), " SAVE "));
+ try std.testing.expectEqualStrings("LOOK here", pardes.tagline.curTail(pane));
try std.testing.expectEqualStrings("body\n", pane.file.?.content);
p.update(.{ .key = .{ .cp = 'u' } });
- try std.testing.expect(std.mem.startsWith(u8, pardes.tagline.curTail(pane), " Save "));
+ try std.testing.expectEqualStrings("Look here", pardes.tagline.curTail(pane));
}
test "$ keeps the selections the command exits 0 on, and a real shell gives that verdict" {