robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
1-- Tests for setting the '[,'] marks when joining lines. 2 3local n =require ( 'test.functional.testnvim' )() 4local t =require ( 'test.testutil' ) 5 6local describe , it , setup =t . describe , t . it , t . setup 7local clear , feed , insert =n . clear , n . feed , n . insert 8local command , expect =n . command , n . expect 9local poke_eventloop =n . poke_eventloop 10 11describe ( 'autoformat join' , function () 12setup ( clear ) 13 14it ( 'is working' , function () 15insert ( [[ 16O sodales, ludite, vos qui 17attamen consulite per voster honur. Tua pulchra facies me fay planszer milies 18 19This line. 20Should be joined with the next line 21and with this line 22 23Results:]] ) 24 25feed ( 'gg' ) 26feed ( '0gqj<cr>' ) 27poke_eventloop () 28 29command ( [[let a=string(getpos("'[")).'/'.string(getpos("']"))]] ) 30command ( "g/^This line/;'}-join" ) 31command ( [[let b=string(getpos("'[")).'/'.string(getpos("']"))]] ) 32command ( "$put ='First test: Start/End '.string(a)" ) 33command ( "$put ='Second test: Start/End '.string(b)" ) 34 35expect ( [[ 36O sodales, ludite, vos qui attamen consulite per voster honur. 37Tua pulchra facies me fay planszer milies 38 39This line. Should be joined with the next line and with this line 40 41Results: 42First test: Start/End '[0, 1, 1, 0]/[0, 2, 1, 0]' 43Second test: Start/End '[0, 4, 11, 0]/[0, 4, 67, 0]']] ) 44end ) 45end )