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 =t . describe , t . it , t . before_each 5local eq , command , fn =t . eq , n . command , n . fn 6local ok =t . ok 7local matches =t . matches 8local clear =n . clear 9 10describe ( ':argument' , function () 11before_each ( function () 12clear () 13end ) 14 15it ( 'does not restart :terminal buffer' , function () 16command ( 'terminal' ) 17n . feed ( [[<C-\><C-N>]] ) 18command ( 'argadd' ) 19n . feed ( [[<C-\><C-N>]] ) 20local bufname_before =fn . bufname ( '%' ) 21local bufnr_before =fn . bufnr ( '%' ) 22matches ( '^term://' , bufname_before ) -- sanity 23 24command ( 'argument 1' ) 25n . feed ( [[<C-\><C-N>]] ) 26 27local bufname_after =fn . bufname ( '%' ) 28local bufnr_after =fn . bufnr ( '%' ) 29eq ( '[' .. bufname_before .. ']' , n . eval ( 'trim(execute("args"))' )) 30ok ( fn . line ( '$' ) > 1 ) 31eq ( bufname_before , bufname_after ) 32eq ( bufnr_before , bufnr_after ) 33end ) 34end )