aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/api/vim_spec.lua15
-rw-r--r--test/functional/lua/vim_spec.lua4
2 files changed, 15 insertions, 4 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index ea5725d836..ef6798dea3 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -1453,10 +1453,21 @@ describe('API', function()
it('set local window options', function()
-- Different to nvim_win_set_option
nvim('set_option_value', 'colorcolumn', '4,3', {win=0, scope='local'})
- eq('4,3', nvim('get_option_value', 'colorcolumn', {scope = 'local'}))
+ eq('4,3', nvim('get_option_value', 'colorcolumn', {win = 0, scope = 'local'}))
command("set modified hidden")
command("enew") -- edit new buffer, window option is reset
- eq('', nvim('get_option_value', 'colorcolumn', {scope = 'local'}))
+ eq('', nvim('get_option_value', 'colorcolumn', {win = 0, scope = 'local'}))
+ end)
+
+ it('get buffer or window-local options', function()
+ nvim('command', 'new')
+ local buf = nvim('get_current_buf').id
+ nvim('buf_set_option', buf, 'tagfunc', 'foobar')
+ eq('foobar', nvim('get_option_value', 'tagfunc', {buf = buf}))
+
+ local win = nvim('get_current_win').id
+ nvim('win_set_option', win, 'number', true)
+ eq(true, nvim('get_option_value', 'number', {win = win}))
end)
end)
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua
index 1af46b7c2f..44e65afc78 100644
--- a/test/functional/lua/vim_spec.lua
+++ b/test/functional/lua/vim_spec.lua
@@ -1396,7 +1396,7 @@ describe('lua stdlib', function()
]]
eq('', funcs.luaeval "vim.bo.filetype")
eq(true, funcs.luaeval "vim.bo[BUF].modifiable")
- matches("Invalid option name: 'nosuchopt'$",
+ matches("unknown option 'nosuchopt'$",
pcall_err(exec_lua, 'return vim.bo.nosuchopt'))
matches("Expected lua string$",
pcall_err(exec_lua, 'return vim.bo[0][0].autoread'))
@@ -1415,7 +1415,7 @@ describe('lua stdlib', function()
eq(0, funcs.luaeval "vim.wo.cole")
eq(0, funcs.luaeval "vim.wo[0].cole")
eq(0, funcs.luaeval "vim.wo[1001].cole")
- matches("Invalid option name: 'notanopt'$",
+ matches("unknown option 'notanopt'$",
pcall_err(exec_lua, 'return vim.wo.notanopt'))
matches("Expected lua string$",
pcall_err(exec_lua, 'return vim.wo[0][0].list'))