Skip to content

Commit 05973ee

Browse files
committed
fix(tests): broadcast test fails
since Nvim 0.11 neovim/neovim#28487 : - nvim_subscribe, nvim_unsubscribe are deprecated - rpcnotify(0) actually broadcasts instead of multicasts, thus nvim_subscribe/nvim_unsubscribe has no effect.
1 parent 4d65226 commit 05973ee

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

test/test_events.py

+5-8
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,17 @@ def test_async_error(vim: Nvim) -> None:
3737

3838

3939
def test_broadcast(vim: Nvim) -> None:
40-
vim.subscribe('event2')
4140
vim.command('call rpcnotify(0, "event1", 1, 2, 3)')
4241
vim.command('call rpcnotify(0, "event2", 4, 5, 6)')
4342
vim.command('call rpcnotify(0, "event2", 7, 8, 9)')
4443
event = vim.next_message()
45-
assert event[1] == 'event2'
46-
assert event[2] == [4, 5, 6]
44+
assert event[1] == 'event1'
45+
assert event[2] == [1, 2, 3]
4746
event = vim.next_message()
4847
assert event[1] == 'event2'
49-
assert event[2] == [7, 8, 9]
50-
vim.unsubscribe('event2')
51-
vim.subscribe('event1')
48+
assert event[2] == [4, 5, 6]
5249
vim.command('call rpcnotify(0, "event2", 10, 11, 12)')
5350
vim.command('call rpcnotify(0, "event1", 13, 14, 15)')
5451
msg = vim.next_message()
55-
assert msg[1] == 'event1'
56-
assert msg[2] == [13, 14, 15]
52+
assert msg[1] == 'event2'
53+
assert msg[2] == [7, 8, 9]

0 commit comments

Comments
 (0)