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 , setup =t . describe , t . it , t . setup 5local eq =t . eq 6local clear =n . clear 7local command =n . command 8local pcall_err =t . pcall_err 9 10setup ( clear ) 11 12describe ( 'uniq()' , function () 13it ( 'errors out when processing special values' , function () 14eq ( 15'Vim(call):E362: Using a boolean value as a Float' , 16pcall_err ( command , 'call uniq([v:true, v:false], "f")' ) 17) 18end ) 19 20it ( 'can yield E882 and stop filtering after that' , function () 21command ( [[ 22function Cmp(a, b) 23if type(a:a) == type([]) || type(a:b) == type([]) 24return [] 25endif 26return (a:a > a:b) - (a:a < a:b) 27endfunction 28]] ) 29eq ( 30'Vim(let):E745: Using a List as a Number' , 31pcall_err ( command , 'let fl = uniq([0, 0, [], 1, 1], "Cmp")' ) 32) 33end ) 34end )