lang_spec.lua 913 B

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