robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
1-- Test argument list commands 2 3local t =require ( 'test.testutil' ) 4local n =require ( 'test.functional.testnvim' )() 5local Screen =require ( 'test.functional.ui.screen' ) 6 7local describe , it , before_each =t . describe , t . it , t . before_each 8local clear , command , eq =n . clear , n . command , t . eq 9local expect_exit =n . expect_exit 10local feed =n . feed 11local pcall_err =t . pcall_err 12 13describe ( 'argument list commands' , function () 14before_each ( clear ) 15 16it ( 'quitting Vim with unedited files in the argument list throws E173' , function () 17command ( 'set nomore' ) 18command ( 'args a b c' ) 19eq ( 'Vim(quit):E173: 2 more files to edit' , pcall_err ( command , 'quit' )) 20end ) 21 22it ( ':confirm quit with unedited files in arglist' , function () 23local screen =Screen . new ( 60 , 6 ) 24command ( 'set nomore' ) 25command ( 'args a b c' ) 26feed ( ':confirm quit\n' ) 27screen : expect ( [[ 28| 29{1:~ }| 30{3: }| 31:confirm quit | 32{6:2 more files to edit. Quit anyway?} | 33{6:[Y]es, (N)o: }^ | 34]] ) 35feed ( 'N' ) 36screen : expect ( [[ 37^ | 38{1:~ }|*4 39| 40]] ) 41feed ( ':confirm quit\n' ) 42screen : expect ( [[ 43| 44{1:~ }| 45{3: }| 46:confirm quit | 47{6:2 more files to edit. Quit anyway?} | 48{6:[Y]es, (N)o: }^ | 49]] ) 50expect_exit ( n . load_adjust ( 1000 ), feed , 'Y' ) 51end ) 52end )