robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
1-- Specs for :wundo and underlying functions 2 3local n =require ( 'test.functional.testnvim' )() 4local t =require ( 'test.testutil' ) 5 6local describe , it , before_each , after_each =t . describe , t . it , t . before_each , t . after_each 7local command =n . command 8local clear =n . clear 9local eval =n . eval 10local set_session =n . set_session 11 12describe ( ':wundo' , function () 13before_each ( clear ) 14after_each ( function () 15os . remove ( eval ( 'getcwd()' ) .. '/foo' ) 16end ) 17 18it ( 'safely fails on new, non-empty buffer' , function () 19command ( 'normal! iabc' ) 20command ( 'wundo foo' ) -- This should not segfault. #1027 21--TODO: check messages for error message 22end ) 23end ) 24 25describe ( 'u_* functions' , function () 26it ( 'safely fail on new, non-empty buffer' , function () 27local session =n . new_session ( false , { 28args ={ 29'-c' , 30'set undodir=. undofile' , 31} , 32} ) 33set_session ( session ) 34command ( 'echo "True"' ) -- Should not error out due to crashed Neovim 35session : close () 36end ) 37end )