aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2017-02-15 02:00:45 +0300
committerZyX <kp-pav@yandex.ru>2017-02-23 19:46:44 +0300
commit4f10d42f829da51cd79ff756ac4db96a6532dbac (patch)
tree9623e92dd5395a0516916534b447e3680fe33c88 /test
parent0eab7ac4b98d9a29e9713251a0402b5fbc37355e (diff)
downloadrneovim-4f10d42f829da51cd79ff756ac4db96a6532dbac.tar.gz
rneovim-4f10d42f829da51cd79ff756ac4db96a6532dbac.tar.bz2
rneovim-4f10d42f829da51cd79ff756ac4db96a6532dbac.zip
buffer: Bind b:changedtick to b:['changedtick'], remove special cases
Diffstat (limited to 'test')
-rw-r--r--test/functional/api/buffer_spec.lua4
-rw-r--r--test/functional/legacy/091_context_variables_spec.lua20
2 files changed, 15 insertions, 9 deletions
diff --git a/test/functional/api/buffer_spec.lua b/test/functional/api/buffer_spec.lua
index 5df8d57050..075504fc8c 100644
--- a/test/functional/api/buffer_spec.lua
+++ b/test/functional/api/buffer_spec.lua
@@ -251,9 +251,6 @@ describe('api/buf', function()
eq(1, funcs.exists('b:lua'))
curbufmeths.del_var('lua')
eq(0, funcs.exists('b:lua'))
- curbuf('set_var', 'changedtick', true)
- eq(true, curbuf('get_var', 'changedtick'))
- neq(true, nvim('eval', 'b:changedtick'))
end)
end)
@@ -262,6 +259,7 @@ describe('api/buf', function()
eq(2, curbufmeths.get_changedtick())
curbufmeths.set_lines(0, 1, false, {'abc\0', '\0def', 'ghi'})
eq(3, curbufmeths.get_changedtick())
+ eq(3, curbufmeths.get_var('changedtick'))
end)
it('buffer_set_var returns the old value', function()
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))