robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. KeyesMerge #40865 from justinmk/fixcif907614088

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