summaryrefslogtreecommitdiff
path: root/test/behaviour/other_files.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/behaviour/other_files.zig')
-rw-r--r--test/behaviour/other_files.zig6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/behaviour/other_files.zig b/test/behaviour/other_files.zig
index e6c104c3..95d4de6d 100644
--- a/test/behaviour/other_files.zig
+++ b/test/behaviour/other_files.zig
@@ -25,6 +25,8 @@ test "other-files: kbdin types at the pane with the keyboard and mousein clicks,
test "other-files: kbdin's keys are the user's: SPC f f opens Find's picker in the pane's tag where jumps walk, not the +Search a script's Find opens" {
var tmp = std.testing.tmpDir(.{});
defer tmp.cleanup();
+ // A work tree of its own: Find searches it, not the one the test runs in.
+ try tmp.dir.createDir(std.testing.io, ".git", .default_dir);
try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "a.txt", .data = "a\n" });
try tmp.dir.writeFile(std.testing.io, .{ .sub_path = "b.txt", .data = "b\n" });
var s = try Session.initFile(std.testing.allocator, "x\n");
@@ -33,7 +35,9 @@ test "other-files: kbdin's keys are the user's: SPC f f opens Find's picker in t
_ = try s.lookFile(s.at("{s}/a.txt", .{buf[0..try tmp.dir.realPath(std.testing.io, &buf)]}));
try s.keys(" ff");
try std.testing.expect(std.mem.indexOf(u8, try s.read("/index"), "+Search") == null);
- // Its rows under the tag of the pane typed at, the cursor on the first.
+ // Its rows under the tag of the pane typed at, the cursor on the first,
+ // the next frame, as the keyboard's: the listing is not the write's.
+ s.tick();
_ = try s.where("▶ a.txt");
_ = try s.where(" b.txt");
}