diff options
author | demiurg337 <dmitro.gedz@gmail.com> | 2019-03-07 14:37:46 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-03-14 00:38:56 +0100 |
commit | 9d207fd876170d1b7123604cd37ed8745115f00e (patch) | |
tree | 9ae4a5b937ec9457ad8058d1139503b9dfce0a1a /test | |
parent | 7fcf2f926fc6baf43d17ba47cb89d02c0ddc4329 (diff) | |
download | rneovim-9d207fd876170d1b7123604cd37ed8745115f00e.tar.gz rneovim-9d207fd876170d1b7123604cd37ed8745115f00e.tar.bz2 rneovim-9d207fd876170d1b7123604cd37ed8745115f00e.zip |
dictwatcheradd(): support b:changedtick #9693
fixes #6635
closes #9693
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ex_cmds/dict_notifications_spec.lua | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/test/functional/ex_cmds/dict_notifications_spec.lua b/test/functional/ex_cmds/dict_notifications_spec.lua index 3d550588e7..48e7e05e4c 100644 --- a/test/functional/ex_cmds/dict_notifications_spec.lua +++ b/test/functional/ex_cmds/dict_notifications_spec.lua @@ -1,12 +1,13 @@ local helpers = require('test.functional.helpers')(after_each) local clear, nvim, source = helpers.clear, helpers.nvim, helpers.source +local insert = helpers.insert local eq, next_msg = helpers.eq, helpers.next_msg local exc_exec = helpers.exc_exec local command = helpers.command local eval = helpers.eval -describe('dictionary change notifications', function() +describe('VimL dictionary notifications', function() local channel before_each(function() @@ -338,4 +339,22 @@ describe('dictionary change notifications', function() eq({'notification', '2', {'foo', {old = 'baz', new = 'bar'}}}, next_msg()) end) end) + + it('for b:changedtick', function() + source([[ + function! OnTickChanged(dict, key, value) + call rpcnotify(g:channel, 'SendChangeTick', a:key, a:value) + endfunction + call dictwatcheradd(b:, 'changedtick', 'OnTickChanged') + ]]) + + insert('t'); + eq({'notification', 'SendChangeTick', {'changedtick', {old = 2, new = 3}}}, + next_msg()) + + command([[call dictwatcherdel(b:, 'changedtick', 'OnTickChanged')]]) + insert('t'); + eq(2, eval('1+1')) -- Still alive? + end) + end) |