neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

put_spec.lua (2561B)


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