robin/laufey

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

Justin M. KeyesMerge #40865 from justinmk/fixcif907614088

master
849 B34 linesraw
1-- vim: set foldmethod=marker foldmarker=[[,]] :
2-- Test for script-local function.
3
4local n = require('test.functional.testnvim')()
5local t = require('test.testutil')
6
7local describe, it, setup = t.describe, t.it, t.setup
8local clear, feed, insert = n.clear, n.feed, n.insert
9local expect = n.expect
10
11describe('source function', function()
12  setup(clear)
13
14  it('is working', function()
15    insert([[
16      fun DoLast()
17        call append(line('$'), "last line")
18      endfun
19      fun DoNothing()
20        call append(line('$'), "nothing line")
21      endfun
22      nnoremap <buffer> _x :call DoNothing()<bar>call DoLast()<cr>]])
23
24    feed(':<C-R>=getline(1,3)<cr><cr>')
25    feed(':<C-R>=getline(4,6)<cr><cr>')
26    feed(':<C-R>=getline(7)<cr><cr>')
27    feed('ggdG')
28    feed('_xggdd')
29
30    expect([[
31      nothing line
32      last line]])
33  end)
34end)