robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
fbcb7a056c
master
1local n =require ( 'test.functional.testnvim' )() 2local t =require ( 'test.testutil' ) 3local Screen =require ( 'test.functional.ui.screen' ) 4 5local describe , it , before_each =t . describe , t . it , t . before_each 6local clear =n . clear 7local exec =n . exec 8local feed =n . feed 9local poke_eventloop =n . poke_eventloop 10 11before_each ( clear ) 12 13describe ( ':global' , function () 14-- oldtest: Test_interrupt_global() 15it ( 'can be interrupted using Ctrl-C in cmdline mode vim-patch:9.0.0082' , function () 16local screen =Screen . new ( 75 , 6 ) 17 18exec ( [[ 19set nohlsearch noincsearch 20cnoremap ; <Cmd>sleep 10<CR> 21call setline(1, repeat(['foo'], 5)) 22]] ) 23 24feed ( ':g/foo/norm :<C-V>;<CR>' ) 25poke_eventloop () -- Wait for :sleep to start 26feed ( '<C-C>' ) 27screen : expect ( [[ 28^foo | 29foo |*4 30{9:Interrupted} | 31]] ) 32 33-- Also test in Ex mode (keep-open cmdwin REPL) 34feed ( '1q:g/foo/norm :<C-V>;<CR>' ) 35poke_eventloop () -- Wait for :sleep to start 36feed ( '<C-C>' ) 37screen : expect ( [[ 38foo | 39{2:[No Name] [+] }| 40{1::}" Keyboard interrupt | 41{1::}^ | 42{3:[Ex mode] }| 43{5:-- INSERT --} | 44]] ) 45end ) 46end )