summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/behaviour/follow.zig21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/behaviour/follow.zig b/test/behaviour/follow.zig
index 5f2acb02..22c1c3d5 100644
--- a/test/behaviour/follow.zig
+++ b/test/behaviour/follow.zig
@@ -148,6 +148,27 @@ test "follow: the cursor past a page's last row takes the keyboard to the next p
try expectConsecutive(shown);
}
+test "follow: a collapsed page is passed over: the cursor past the page before it scrolls the chain, never into the fold" {
+ var s = try init();
+ defer s.deinit();
+ const head = try s.focused();
+ try s.write(s.at("/pane/{d}/exec", .{head}), "Follow\n");
+ const second = try newest(&s);
+ try s.write(s.at("/pane/{d}/exec", .{head}), "Follow\n");
+ const third = try newest(&s);
+ try s.write(s.at("/pane/{d}/exec", .{third}), "Collapse\n");
+ const ps = try pages(&s);
+ try std.testing.expectEqual(@as(usize, 2), ps.len);
+ try s.keys(s.at("{d}j", .{ps[0].rows}));
+ try std.testing.expectEqual(second, try s.focused());
+ // Past the second page's last row: the second is the chain's end now.
+ try s.keys(s.at("{d}j", .{ps[1].rows}));
+ try std.testing.expectEqual(second, try s.focused());
+ const moved = try pages(&s);
+ try std.testing.expect(moved[0].first > 1);
+ try expectConsecutive(moved);
+}
+
test "follow: Unfollow leaves a twin with its own scroll and closes the chain up; Del of the head makes the next one head" {
var s = try init();
defer s.deinit();