robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
1local t =require ( 'test.testutil' ) 2local n =require ( 'test.functional.testnvim' )() 3 4local describe , it , before_each , finally =t . describe , t . it , t . before_each , t . finally 5local eq , command , fn =t . eq , n . command , n . fn 6local ok =t . ok 7local matches =t . matches 8local pcall_err =t . pcall_err 9local clear =n . clear 10local feed =n . feed 11 12describe ( ':edit' , function () 13before_each ( function () 14clear () 15end ) 16 17it ( 'E77 message' , function () 18local glob_files ={ 'Xedit-glob-one.js' , 'Xedit-glob-two.js' } 19 20finally ( function () 21for _ , file in ipairs ( glob_files ) do 22os . remove ( file ) 23end 24end ) 25 26for _ , file in ipairs ( glob_files ) do 27t . write_file ( file , '' ) 28end 29 30eq ( 31'Vim(edit):E77: Too many file names (glob not allowed)' , 32pcall_err ( command , 'edit Xedit-glob-*.js' ) 33) 34end ) 35 36it ( 'without arguments does not restart :terminal buffer' , function () 37command ( 'terminal' ) 38feed ( [[<C-\><C-N>]] ) 39local bufname_before =fn . bufname ( '%' ) 40local bufnr_before =fn . bufnr ( '%' ) 41matches ( '^term://' , bufname_before ) -- sanity 42 43command ( 'edit' ) 44 45local bufname_after =fn . bufname ( '%' ) 46local bufnr_after =fn . bufnr ( '%' ) 47ok ( fn . line ( '$' ) > 1 ) 48eq ( bufname_before , bufname_after ) 49eq ( bufnr_before , bufnr_after ) 50end ) 51end )