robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
1local n =require ( 'test.functional.testnvim' )() 2local t =require ( 'test.testutil' ) 3 4local describe , it , before_each =t . describe , t . it , t . before_each 5local clear =n . clear 6local insert =n . insert 7local feed =n . feed 8local expect =n . expect 9local feed_command =n . feed_command 10local command =n . command 11 12describe ( ':undojoin command' , function () 13before_each ( function () 14clear () 15insert ( [[ 16Line of text 1 17Line of text 2]] ) 18feed_command ( 'goto 1' ) 19end ) 20it ( 'joins changes in a buffer' , function () 21feed_command ( 'undojoin | delete' ) 22expect ( [[ 23Line of text 2]] ) 24feed ( 'u' ) 25expect ( [[ 26]] ) 27end ) 28it ( 'does not corrupt undolist when connected with redo' , function () 29feed ( 'ixx<esc>' ) 30feed_command ( 'undojoin | redo' ) 31expect ( [[ 32xxLine of text 1 33Line of text 2]] ) 34end ) 35it ( 'does not raise an error when called twice' , function () 36command ( 'undojoin | undojoin' ) 37end ) 38end )