robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
af23d17388
master
1" Test behavior of interrupt() 2 3let s: bufwritepre_called = 0 4let s: bufwritepost_called = 0 5 6func s: bufwritepre () 7let s: bufwritepre_called = 1 8call interrupt () 9endfunction 10 11func s: bufwritepost () 12let s: bufwritepost_called = 1 13endfunction 14 15func Test_interrupt () 16new Xinterrupt 17let n = 0 18try 19au BufWritePre Xinterrupt call s: bufwritepre () 20au BufWritePost Xinterrupt call s: bufwritepost () 21w ! 22catch /^Vim:Interrupt$/ 23endtry 24call assert_equal ( 1 , s: bufwritepre_called ) 25call assert_equal ( 0 , s: bufwritepost_called ) 26call assert_equal ( 0 , filereadable ( 'Xinterrupt' )) 27 28au ! BufWritePre 29au ! BufWritePost 30endfunc 31 32" vim: shiftwidth=2 sts=2 expandtab