robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
f907614088
master
1-- Test if fnameescape is correct for special chars like! 2 3local n =require ( 'test.functional.testnvim' )() 4local t =require ( 'test.testutil' ) 5 6local describe , it , setup , teardown =t . describe , t . it , t . setup , t . teardown 7local clear =n . clear 8local command , expect =n . command , n . expect 9 10describe ( 'fnameescape' , function () 11setup ( clear ) 12 13it ( 'is working' , function () 14command ( 'let fname = "Xspa ce"' ) 15command ( 'try | exe "w! " . fnameescape(fname) | put=\'Space\' | endtry' ) 16command ( 'let fname = "Xemark!"' ) 17command ( 'try | exe "w! " . fnameescape(fname) | put=\'ExclamationMark\' | endtry' ) 18 19expect ( [[ 20 21Space 22ExclamationMark]] ) 23end ) 24 25teardown ( function () 26os . remove ( 'Xspa ce' ) 27os . remove ( 'Xemark!' ) 28end ) 29end )