diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2024-02-12 05:50:39 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-12 05:50:39 -0800 |
commit | 0185152802d4a84258a9a04c1d86a7e27d37d721 (patch) | |
tree | 3880293029a66a8a009fff2f3489849c247c36db /test/functional/api/buffer_updates_spec.lua | |
parent | 210ec3b7a94c64263703087163a957567ddf4224 (diff) | |
download | rneovim-0185152802d4a84258a9a04c1d86a7e27d37d721.tar.gz rneovim-0185152802d4a84258a9a04c1d86a7e27d37d721.tar.bz2 rneovim-0185152802d4a84258a9a04c1d86a7e27d37d721.zip |
refactor(tests): get channel id via nvim_get_chan_info #27441
Minor "best practices" nudge.
Diffstat (limited to 'test/functional/api/buffer_updates_spec.lua')
-rw-r--r-- | test/functional/api/buffer_updates_spec.lua | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/functional/api/buffer_updates_spec.lua b/test/functional/api/buffer_updates_spec.lua index d68c60e54c..262ca40e28 100644 --- a/test/functional/api/buffer_updates_spec.lua +++ b/test/functional/api/buffer_updates_spec.lua @@ -482,7 +482,7 @@ describe('API: buffer events:', function() end) it('does not get confused if enabled/disabled many times', function() - local channel = api.nvim_get_api_info()[1] + local channel = api.nvim_get_chan_info(0).id local b, tick = editoriginal(false) -- Enable buffer events many times. @@ -564,7 +564,7 @@ describe('API: buffer events:', function() -- make sure there are no other pending nvim_buf_lines_event messages going to -- channel 1 - local channel1 = request(1, 'nvim_get_api_info')[1] + local channel1 = request(1, 'nvim_get_chan_info', 0).id eval('rpcnotify(' .. channel1 .. ', "Hello")') wantn(1, 'Hello', {}) @@ -576,14 +576,14 @@ describe('API: buffer events:', function() -- make sure there are no other pending nvim_buf_lines_event messages going to -- channel 1 - channel1 = request(1, 'nvim_get_api_info')[1] + channel1 = request(1, 'nvim_get_chan_info', 0).id eval('rpcnotify(' .. channel1 .. ', "Hello Again")') wantn(1, 'Hello Again', {}) end) it('works with :diffput and :diffget', function() local b1, tick1 = editoriginal(true, { 'AAA', 'BBB' }) - local channel = api.nvim_get_api_info()[1] + local channel = api.nvim_get_chan_info(0).id command('diffthis') command('rightbelow vsplit') local b2, tick2 = open(true, { 'BBB', 'CCC' }) @@ -700,7 +700,7 @@ describe('API: buffer events:', function() it('detaches if the buffer is closed', function() local b, tick = editoriginal(true, { 'AAA' }) - local channel = api.nvim_get_api_info()[1] + local channel = api.nvim_get_chan_info(0).id -- Test that buffer events are working. command('normal! x') @@ -739,7 +739,7 @@ describe('API: buffer events:', function() it(':enew! does not detach hidden buffer', function() local b, tick = editoriginal(true, { 'AAA', 'BBB' }) - local channel = api.nvim_get_api_info()[1] + local channel = api.nvim_get_chan_info(0).id command('set undoreload=1 hidden') command('normal! x') @@ -753,7 +753,7 @@ describe('API: buffer events:', function() it('stays attached if the buffer is hidden', function() local b, tick = editoriginal(true, { 'AAA' }) - local channel = api.nvim_get_api_info()[1] + local channel = api.nvim_get_chan_info(0).id -- Test that buffer events are working. command('normal! x') |