robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
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 () 12setup ( clear ) 13 14it ( 'is working' , function () 15insert ( [[ 16fun DoLast() 17call append(line('$'), "last line") 18endfun 19fun DoNothing() 20call append(line('$'), "nothing line") 21endfun 22nnoremap <buffer> _x :call DoNothing()<bar>call DoLast()<cr>]] ) 23 24feed ( ':<C-R>=getline(1,3)<cr><cr>' ) 25feed ( ':<C-R>=getline(4,6)<cr><cr>' ) 26feed ( ':<C-R>=getline(7)<cr><cr>' ) 27feed ( 'ggdG' ) 28feed ( '_xggdd' ) 29 30expect ( [[ 31nothing line 32last line]] ) 33end ) 34end )