aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/vim_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-09-23 15:59:37 +0800
committerGitHub <noreply@github.com>2023-09-23 15:59:37 +0800
commit5331d5772ffbbdb3635d0a4b41306817097e86de (patch)
tree259eea5584b6e0aa2452da474db434eda521cc08 /test/functional/api/vim_spec.lua
parentc0a29931e29bbb40650df01918826cdb64e8fc32 (diff)
downloadrneovim-5331d5772ffbbdb3635d0a4b41306817097e86de.tar.gz
rneovim-5331d5772ffbbdb3635d0a4b41306817097e86de.tar.bz2
rneovim-5331d5772ffbbdb3635d0a4b41306817097e86de.zip
fix(lua): show error message when failing to set variable (#25321)
Diffstat (limited to 'test/functional/api/vim_spec.lua')
-rw-r--r--test/functional/api/vim_spec.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index f734bfb0c0..fcf3eae5ec 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -1353,6 +1353,9 @@ describe('API', function()
-- Set readonly v: var.
eq('Key is read-only: count',
pcall_err(request, 'nvim_set_vvar', 'count', 42))
+ -- Set non-existent v: var.
+ eq('Dictionary is locked',
+ pcall_err(request, 'nvim_set_vvar', 'nosuchvar', 42))
-- Set writable v: var.
meths.set_vvar('errmsg', 'set by API')
eq('set by API', meths.get_vvar('errmsg'))