lang_spec.lua (913B)
1 local t = require('test.testutil') 2 local n = require('test.functional.testnvim')() 3 4 local clear, eval, eq = n.clear, n.eval, t.eq 5 local exc_exec, source = n.exc_exec, n.source 6 7 describe('vimscript', function() 8 before_each(clear) 9 10 it('parses `<SID>` with turkish locale', function() 11 if exc_exec('lang ctype tr_TR.UTF-8') ~= 0 then 12 pending('Locale tr_TR.UTF-8 not supported') 13 return 14 end 15 source([[ 16 let s:foo = 1 17 func! <sid>_dummy_function() 18 echo 1 19 endfunc 20 au VimEnter * call <sid>_dummy_function() 21 ]]) 22 eq(nil, string.find(eval('v:errmsg'), '^E129')) 23 end) 24 25 it('str2float is not affected by locale', function() 26 if exc_exec('lang ctype sv_SE.UTF-8') ~= 0 then 27 pending('Locale sv_SE.UTF-8 not supported') 28 return 29 end 30 clear { env = { LANG = '', LC_NUMERIC = 'sv_SE.UTF-8' } } 31 eq(2.2, eval('str2float("2.2")')) 32 end) 33 end)