lang_spec.lua 886 B

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