summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_channel.vim
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2022-04-18 14:07:46 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-18 14:07:46 +0100
commit03cca297df5210f94be2246cfdb1ee9a30454bea (patch)
treecc2f525d9f41ad11e2d0520c0c7b0d8d557455f8 /src/testdir/test_channel.vim
parent53e8f3ffdf80dbd24a60adb51f8f21982fd41c57 (diff)
patch 8.2.4780: parsing an LSP message fails when it is splitv8.2.4780
Problem: Parsing an LSP message fails when it is split. Solution: Collapse the received data before parsing. (Yegappan Lakshmanan, closes #10215)
Diffstat (limited to 'src/testdir/test_channel.vim')
-rw-r--r--src/testdir/test_channel.vim12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index e270a4be7a..6fef421e56 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -2580,6 +2580,11 @@ func LspTests(port)
call assert_equal({'id': 14, 'jsonrpc': '2.0', 'result': 'extra-hdr-fields'},
\ resp)
+ " Test for processing delayed payload
+ let resp = ch_evalexpr(ch, #{method: 'delayed-payload', params: {}})
+ call assert_equal({'id': 15, 'jsonrpc': '2.0', 'result': 'delayed-payload'},
+ \ resp)
+
" Test for processing a HTTP header without the Content-Length field
let resp = ch_evalexpr(ch, #{method: 'hdr-without-len', params: {}},
\ #{timeout: 200})
@@ -2629,13 +2634,6 @@ func LspTests(port)
call assert_equal([], g:lspNotif)
" Restore the callback function
call ch_setoptions(ch, #{callback: 'LspCb'})
- let g:lspNotif = []
- call ch_sendexpr(ch, #{method: 'echo', params: #{s: 'no-callback'}})
- " Send a ping to wait for all the notification messages to arrive
- call assert_equal('alive', ch_evalexpr(ch, #{method: 'ping'}).result)
- call assert_equal([#{jsonrpc: '2.0', result:
- \ #{method: 'echo', jsonrpc: '2.0', params: #{s: 'no-callback'}}}],
- \ g:lspNotif)
" " Test for sending a raw message
" let g:lspNotif = []