robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. KeyesMerge #40865 from justinmk/fixcif907614088

master
1.5 KiB40 linesraw
1local n = require('test.functional.testnvim')()
2local t = require('test.testutil')
3local Screen = require('test.functional.ui.screen')
4
5local describe, it, before_each = t.describe, t.it, t.before_each
6local clear = n.clear
7local feed = n.feed
8local fn = n.fn
9
10before_each(clear)
11
12describe(':move', function()
13  -- oldtest: Test_move_undo()
14  it('redraws correctly when undone', function()
15    local screen = Screen.new(60, 10)
16
17    fn.setline(1, { 'First', 'Second', 'Third', 'Fourth' })
18    feed('gg:move +1<CR>')
19    screen:expect([[
20      Second                                                      |
21      ^First                                                       |
22      Third                                                       |
23      Fourth                                                      |
24      {1:~                                                           }|*5
25      :move +1                                                    |
26    ]])
27
28    -- here the display would show the last few lines scrolled down
29    feed('u')
30    feed(':<Esc>')
31    screen:expect([[
32      ^First                                                       |
33      Second                                                      |
34      Third                                                       |
35      Fourth                                                      |
36      {1:~                                                           }|*5
37                                                                  |
38    ]])
39  end)
40end)