aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/vim_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-02-27 10:29:46 +0100
committerGitHub <noreply@github.com>2017-02-27 10:29:46 +0100
commitc318d8e672a3b1dfe4ba7954dbca61c509c2b99c (patch)
tree282a6090dbf2d9017a3ad0a7382df08b2d320a05 /test/functional/api/vim_spec.lua
parent8c8ce1832e780f87b2922ba3acf0d44f78c50931 (diff)
parenta85021068de95ef7c69b3b93b31bc32fbb154ed3 (diff)
downloadrneovim-c318d8e672a3b1dfe4ba7954dbca61c509c2b99c.tar.gz
rneovim-c318d8e672a3b1dfe4ba7954dbca61c509c2b99c.tar.bz2
rneovim-c318d8e672a3b1dfe4ba7954dbca61c509c2b99c.zip
Merge #6112 from ZyX-I/split-eval'/buf_get_changedtick
Better b:changedtick support
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r--test/functional/api/vim_spec.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index ce6c52e334..3348368a36 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -7,6 +7,8 @@ local os_name = helpers.os_name
local meths = helpers.meths
local funcs = helpers.funcs
local request = helpers.request
+local meth_pcall = helpers.meth_pcall
+local command = helpers.command
describe('api', function()
before_each(clear)
@@ -43,7 +45,7 @@ describe('api', function()
it('works', function()
nvim('command', 'let g:v1 = "a"')
nvim('command', 'let g:v2 = [1, 2, {"v3": 3}]')
- eq({v1 = 'a', v2 = {1, 2, {v3 = 3}}}, nvim('eval', 'g:'))
+ eq({v1 = 'a', v2 = { 1, 2, { v3 = 3 } } }, nvim('eval', 'g:'))
end)
it('handles NULL-initialized strings correctly', function()
@@ -65,7 +67,7 @@ describe('api', function()
describe('nvim_call_function', function()
it('works', function()
- nvim('call_function', 'setqflist', {{{ filename = 'something', lnum = 17}}, 'r'})
+ nvim('call_function', 'setqflist', { { { filename = 'something', lnum = 17 } }, 'r' })
eq(17, nvim('call_function', 'getqflist', {})[1].lnum)
eq(17, nvim('call_function', 'eval', {17}))
eq('foo', nvim('call_function', 'simplify', {'this/./is//redundant/../../../foo'}))
@@ -117,6 +119,11 @@ describe('api', function()
eq(1, funcs.exists('g:lua'))
meths.del_var('lua')
eq(0, funcs.exists('g:lua'))
+ eq({false, 'Key "lua" doesn\'t exist'}, meth_pcall(meths.del_var, 'lua'))
+ meths.set_var('lua', 1)
+ command('lockvar lua')
+ eq({false, 'Key is locked: lua'}, meth_pcall(meths.del_var, 'lua'))
+ eq({false, 'Key is locked: lua'}, meth_pcall(meths.set_var, 'lua', 1))
end)
it('vim_set_var returns the old value', function()
@@ -396,7 +403,7 @@ describe('api', function()
eq(1, meths.get_var('avar'))
req = {
- {'nvim_set_var', {'bvar', {2,3}}},
+ { 'nvim_set_var', { 'bvar', { 2, 3 } } },
12,
}
status, err = pcall(meths.call_atomic, req)