robin/laufey

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

Justin M. KeyesMerge #40865 from justinmk/fixcif907614088

master
2.6 KiB60 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 source = n.source
8
9describe('put', function()
10  before_each(clear)
11
12  -- oldtest: Test_put_other_window()
13  it('above topline in buffer in two splits', function()
14    local screen = Screen.new(80, 10)
15    source([[
16      40vsplit
17      0put ='some text at the top'
18      put ='  one more text'
19      put ='  two more text'
20      put ='  three more text'
21      put ='  four more text'
22    ]])
23
24    screen:expect([[
25      some text at the top                    │some text at the top                   |
26        one more text                         │  one more text                        |
27        two more text                         │  two more text                        |
28        three more text                       │  three more text                      |
29        ^four more text                        │  four more text                       |
30                                              │                                       |
31      {1:~                                       }│{1:~                                      }|*2
32      {3:[No Name] [+]                            }{2:[No Name] [+]                          }|
33                                                                                      |
34    ]])
35  end)
36
37  -- oldtest: Test_put_in_last_displayed_line()
38  it('in last displayed line', function()
39    local screen = Screen.new(75, 10)
40    source([[
41      autocmd CursorMoved * eval line('w$')
42      let @a = 'x'->repeat(&columns * 2 - 2)
43      eval range(&lines)->setline(1)
44      call feedkeys('G"ap')
45    ]])
46
47    screen:expect([[
48      2                                                                          |
49      3                                                                          |
50      4                                                                          |
51      5                                                                          |
52      6                                                                          |
53      7                                                                          |
54      8                                                                          |
55      9xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
56      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx^x |
57                                                                                 |
58    ]])
59  end)
60end)