lang_spec.lua 911 B

1234567891011121314151617181920212223242526272829303132
  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('vimscript', 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. let s:foo = 1
  13. func! <sid>_dummy_function()
  14. echo 1
  15. endfunc
  16. au VimEnter * call <sid>_dummy_function()
  17. ]])
  18. eq(nil, string.find(eval('v:errmsg'), '^E129'))
  19. end)
  20. it('str2float is not affected by locale', function()
  21. if exc_exec('lang ctype sv_SE.UTF-8') ~= 0 then
  22. pending("Locale sv_SE.UTF-8 not supported")
  23. return
  24. end
  25. clear{env={LANG="", LC_NUMERIC="sv_SE.UTF-8"}}
  26. eq(2.2, eval('str2float("2.2")'))
  27. end)
  28. end)