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 clear , eq , assert_alive =n . clear , t . eq , n . assert_alive 6local command =n . command 7local api =n . api 8 9describe ( 'sign' , function () 10before_each ( clear ) 11describe ( 'unplace {id}' , function () 12describe ( 'without specifying buffer' , function () 13it ( 'deletes the sign from all buffers' , function () 14-- place a sign with id 34 to first buffer 15command ( 'sign define Foo text=+ texthl=Delimiter linehl=Comment numhl=Number' ) 16local buf1 =api . nvim_eval ( 'bufnr("%")' ) 17command ( 'sign place 34 line=3 name=Foo buffer=' .. buf1 ) 18-- create a second buffer and place the sign on it as well 19command ( 'new' ) 20local buf2 =api . nvim_eval ( 'bufnr("%")' ) 21command ( 'sign place 34 line=3 name=Foo buffer=' .. buf2 ) 22-- now unplace without specifying a buffer 23command ( 'sign unplace 34' ) 24eq ( '--- Signs ---' , api . nvim_exec ( 'sign place buffer=' .. buf1 , true )) 25eq ( '--- Signs ---' , api . nvim_exec ( 'sign place buffer=' .. buf2 , true )) 26end ) 27end ) 28end ) 29 30describe ( 'define {id}' , function () 31it ( 'does not leak memory when specifying multiple times the same argument' , function () 32command ( 'sign define Foo culhl=Normal culhl=Normal' ) 33assert_alive () 34end ) 35end ) 36end )