summaryrefslogtreecommitdiff
path: root/test/behaviour/mouse.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/behaviour/mouse.zig')
-rw-r--r--test/behaviour/mouse.zig17
1 files changed, 10 insertions, 7 deletions
diff --git a/test/behaviour/mouse.zig b/test/behaviour/mouse.zig
index 951ab493..0e22416f 100644
--- a/test/behaviour/mouse.zig
+++ b/test/behaviour/mouse.zig
@@ -25,9 +25,10 @@ test "mouse: a double-click selects a word, a line, a bracketed or quoted text,
try s.click(w.at, w.into, 1);
try s.expect(sel, "");
}
- // In the tag too: what it selected is what a yank takes.
- try s.click("Follow Del", "Follow D".len, 1);
- try s.click("Follow Del", "Follow D".len, 1);
+ // In the tag too: what it selected is what a yank takes (its computed
+ // Del, after Keep: the file is reading).
+ try s.click("Keep Del", "Keep D".len, 1);
+ try s.click("Keep Del", "Keep D".len, 1);
try s.keys("\x1by:ggP");
try s.expect(s.at("/pane/{d}/body", .{n}), "Delcall foo_bar(a, b)\nsay \"hi there\"\n");
}
@@ -120,13 +121,15 @@ test "mouse: a B1 sweep over several lines is a stream, as acme's, in a body and
// Upward, the same text.
try mouse(&s, "m {d} {d} 1\nm {d} {d} 1\nm {d} {d} 3\nm {d} {d} 0\n", .{ x + 1, y + 2, x + 2, y, x + 2, y, x + 2, y });
try s.expect(body, "alarlie\n");
- // A tag of several rows sweeps the same way.
+ // A tag of several rows sweeps the same way, in its own text (its
+ // computed words are read-only, UX K'1).
const tag = s.at("/pane/{d}/tag", .{n});
- try s.write(tag, "\nLook Edit");
+ try s.write(tag, "Collapse\nLook Edit");
+ const was = try s.read(tag);
const tx, const ty = try s.where("Collapse");
const lx, const ly = try s.where("Look Edit");
try mouse(&s, "m {d} {d} 1\nm {d} {d} 1\nm {d} {d} 3\nm {d} {d} 0\n", .{ tx + 3, ty, lx + 1, ly, lx + 1, ly, lx + 1, ly });
- try s.expect(tag, "/test.txt Save Term Colok Edit");
+ try s.expect(tag, s.at("{s}Colok Edit", .{was[0 .. was.len - "Collapse\nLook Edit".len]}));
}
test "mouse: a click on either half of a wide character lands before it, in the text and on a tag's path, and the caret steps over it whole" {
@@ -157,7 +160,7 @@ test "mouse: a click on either half of a wide character lands before it, in the
// Typed past the tag's words, a two-byte λ goes in and one backspace
// takes it out whole.
const tag = try s.read(s.at("/pane/{d}/tag", .{n}));
- try s.click("Follow Del", "Follow Del".len + 1, 1);
+ try s.click("Keep Del", "Keep Del".len + 1, 1);
const caret = (try s.cursor()).?;
// A clicked tag is in normal mode: `i` types at the caret.
try s.keys("iλ");