aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/move_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
commit21cb7d04c387e4198ca8098a884c78b56ffcf4c2 (patch)
tree84fe5690df1551f0bb2bdfe1a13aacd29ebc1de7 /test/functional/legacy/move_spec.lua
parentd9c904f85a23a496df4eb6be42aa43f007b22d50 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-colorcolchar.tar.gz
rneovim-colorcolchar.tar.bz2
rneovim-colorcolchar.zip
Merge remote-tracking branch 'upstream/master' into colorcolcharcolorcolchar
Diffstat (limited to 'test/functional/legacy/move_spec.lua')
-rw-r--r--test/functional/legacy/move_spec.lua49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/functional/legacy/move_spec.lua b/test/functional/legacy/move_spec.lua
new file mode 100644
index 0000000000..855996da8f
--- /dev/null
+++ b/test/functional/legacy/move_spec.lua
@@ -0,0 +1,49 @@
+local helpers = require('test.functional.helpers')(after_each)
+local Screen = require('test.functional.ui.screen')
+local clear = helpers.clear
+local feed = helpers.feed
+local funcs = helpers.funcs
+
+before_each(clear)
+
+describe(':move', function()
+ -- oldtest: Test_move_undo()
+ it('redraws correctly when undone', function()
+ local screen = Screen.new(60, 10)
+ screen:set_default_attr_ids({
+ [0] = {bold = true, foreground = Screen.colors.Blue}, -- NonText
+ })
+ screen:attach()
+
+ funcs.setline(1, {'First', 'Second', 'Third', 'Fourth'})
+ feed('gg:move +1<CR>')
+ screen:expect([[
+ Second |
+ ^First |
+ Third |
+ Fourth |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ :move +1 |
+ ]])
+
+ -- here the display would show the last few lines scrolled down
+ feed('u')
+ feed(':<Esc>')
+ screen:expect([[
+ ^First |
+ Second |
+ Third |
+ Fourth |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ |
+ ]])
+ end)
+end)