aboutsummaryrefslogtreecommitdiff
path: root/test/functional/legacy/091_context_variables_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/legacy/091_context_variables_spec.lua')
-rw-r--r--test/functional/legacy/091_context_variables_spec.lua20
1 files changed, 14 insertions, 6 deletions
diff --git a/test/functional/legacy/091_context_variables_spec.lua b/test/functional/legacy/091_context_variables_spec.lua
index edf497d397..c08a58e14b 100644
--- a/test/functional/legacy/091_context_variables_spec.lua
+++ b/test/functional/legacy/091_context_variables_spec.lua
@@ -13,6 +13,14 @@ describe('context variables', function()
-- Test for getbufvar().
-- Use strings to test for memory leaks.
source([[
+ function Getbufscope(buf, ...)
+ let ret = call('getbufvar', [a:buf, ''] + a:000)
+ if type(ret) == type({})
+ return filter(copy(ret), 'v:key isnot# "changedtick"')
+ else
+ return ret
+ endif
+ endfunction
let t:testvar='abcd'
$put =string(gettabvar(1, 'testvar'))
$put =string(gettabvar(1, 'testvar'))
@@ -20,14 +28,14 @@ describe('context variables', function()
let def_num = '5678'
$put =string(getbufvar(1, 'var_num'))
$put =string(getbufvar(1, 'var_num', def_num))
- $put =string(getbufvar(1, ''))
- $put =string(getbufvar(1, '', def_num))
+ $put =string(Getbufscope(1))
+ $put =string(Getbufscope(1, def_num))
unlet b:var_num
$put =string(getbufvar(1, 'var_num', def_num))
- $put =string(getbufvar(1, ''))
- $put =string(getbufvar(1, '', def_num))
- $put =string(getbufvar(9, ''))
- $put =string(getbufvar(9, '', def_num))
+ $put =string(Getbufscope(1))
+ $put =string(Getbufscope(1, def_num))
+ $put =string(Getbufscope(9))
+ $put =string(Getbufscope(9, def_num))
unlet def_num
$put =string(getbufvar(1, '&autoindent'))
$put =string(getbufvar(1, '&autoindent', 1))