From 10627e889e82a82560b6fc48ea0ca20e1963d07f Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Wed, 24 Feb 2021 02:41:00 +0100 Subject: feat: advanced normal mode (#463) Add j and k to normal mode and H and L to jump at top and bottom of displayed results --- lua/tests/automated/scroller_spec.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'lua/tests') diff --git a/lua/tests/automated/scroller_spec.lua b/lua/tests/automated/scroller_spec.lua index dcc55a0..98233b4 100644 --- a/lua/tests/automated/scroller_spec.lua +++ b/lua/tests/automated/scroller_spec.lua @@ -111,4 +111,22 @@ describe('scroller', function() eq(0, scroller(23, 112, 23)) end) end) + + describe('should give top and bottom index', function() + it('should handle ascending', function() + eq(0, p_scroller.top('ascending', 20, 1000)) + eq(19, p_scroller.bottom('ascending', 20, 1000)) + + eq(0, p_scroller.top('ascending', 20, 10)) + eq(9, p_scroller.bottom('ascending', 20, 10)) + end) + + it('should handle descending', function() + eq(0, p_scroller.top('descending', 20, 1000)) + eq(19, p_scroller.bottom('descending', 20, 1000)) + + eq(10, p_scroller.top('descending', 20, 10)) + eq(19, p_scroller.bottom('descending', 20, 10)) + end) + end) end) -- cgit v1.2.3