robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
1-- Test for sourcing a file with CTRL-V's at the end of the line 2 3local n =require ( 'test.functional.testnvim' )() 4local t =require ( 'test.testutil' ) 5 6local describe , it , before_each , teardown =t . describe , t . it , t . before_each , t . teardown 7local clear , feed , insert =n . clear , n . feed , n . insert 8local feed_command , expect =n . feed_command , n . expect 9 10describe ( '028' , function () 11before_each ( clear ) 12 13it ( 'CTRL-V at the end of the line is working' , function () 14insert ( [[ 15firstline 16map __1 afirst 17map __2 asecond 18map __3 athird 19map __4 afourth 20map __5 afifth 21map __1 asdX 22map __2 asdXX 23map __3 asdXX 24map __4 asdXXX 25map __5 asdXXX 26lastline]] ) 27 28feed ( ':%s/X/<C-v><C-v>/g<cr>' ) 29feed ( ':/firstline/+1,/lastline/-1w! Xtestfile<cr>' ) 30feed_command ( 'so Xtestfile' ) 31feed_command ( '%d' ) 32feed ( 'Gmm__1<Esc><Esc>__2<Esc>__3<Esc><Esc>__4<Esc>__5<Esc>' ) 33feed ( ":'m,$s/<C-v><C-@>/0/g<cr>" ) 34 35expect ( [[ 36sd 37map __2 asdsecondsdsd0map __5 asd0fifth]] ) 38end ) 39 40it ( 'CTRL-X/CTRL-A is working' , function () 41insert ( [[ 4212352 43 4412354]] ) 45feed_command ( '/12352' ) 46feed ( '<C-A>' ) 47feed_command ( '/12354' ) 48feed ( '<C-X>' ) 49expect ( [[ 5012353 51 5212353]] ) 53end ) 54 55teardown ( function () 56os . remove ( 'Xtestfile' ) 57end ) 58end )