diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-01-25 18:31:31 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-01-25 18:31:31 +0000 |
commit | 9243becbedbb6a1592208051f8fa2b090dcc5e7d (patch) | |
tree | 607c2a862ec3f4399b8766383f6f8e04c4aa43b4 /test/functional/api/server_notifications_spec.lua | |
parent | 9e40b6e9e1bc67f2d856adb837ee64dd0e25b717 (diff) | |
parent | 3c48d3c83fc21dbc0841f9210f04bdb073d73cd1 (diff) | |
download | rneovim-9243becbedbb6a1592208051f8fa2b090dcc5e7d.tar.gz rneovim-9243becbedbb6a1592208051f8fa2b090dcc5e7d.tar.bz2 rneovim-9243becbedbb6a1592208051f8fa2b090dcc5e7d.zip |
Merge remote-tracking branch 'upstream/master' into usermarksusermarks
Diffstat (limited to 'test/functional/api/server_notifications_spec.lua')
-rw-r--r-- | test/functional/api/server_notifications_spec.lua | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/test/functional/api/server_notifications_spec.lua b/test/functional/api/server_notifications_spec.lua index 1c00f001ff..53642858b2 100644 --- a/test/functional/api/server_notifications_spec.lua +++ b/test/functional/api/server_notifications_spec.lua @@ -1,12 +1,16 @@ local helpers = require('test.functional.helpers')(after_each) +local assert_log = helpers.assert_log local eq, clear, eval, command, nvim, next_msg = helpers.eq, helpers.clear, helpers.eval, helpers.command, helpers.nvim, helpers.next_msg local meths = helpers.meths local exec_lua = helpers.exec_lua local retry = helpers.retry -local isCI = helpers.isCI +local is_ci = helpers.is_ci local assert_alive = helpers.assert_alive +local skip = helpers.skip + +local testlog = 'Xtest-server-notify-log' describe('notify', function() local channel @@ -16,6 +20,10 @@ describe('notify', function() channel = nvim('get_api_info')[1] end) + after_each(function() + os.remove(testlog) + end) + describe('passing a valid channel id', function() it('sends the notification/args to the corresponding channel', function() eval('rpcnotify('..channel..', "test-event", 1, 2, 3)') @@ -71,20 +79,18 @@ describe('notify', function() end) it('unsubscribe non-existing event #8745', function() + clear{env={ + NVIM_LOG_FILE=testlog, + }} nvim('subscribe', 'event1') nvim('unsubscribe', 'doesnotexist') + assert_log("tried to unsubscribe unknown event 'doesnotexist'", testlog, 10) nvim('unsubscribe', 'event1') assert_alive() end) it('cancels stale events on channel close', function() - if isCI() then - pending('hangs on CI #14083 #15251') - return - elseif helpers.skip_fragile(pending) then - return - end - if helpers.pending_win32(pending) then return end + skip(is_ci(), 'hangs on CI #14083 #15251') local catchan = eval("jobstart(['cat'], {'rpc': v:true})") local catpath = eval('exepath("cat")') eq({id=catchan, argv={catpath}, stream='job', mode='rpc', client = {}}, exec_lua ([[ |