aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/server_requests_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-12-30 01:01:23 -0500
committerJustin M. Keyes <justinkz@gmail.com>2015-12-30 01:01:23 -0500
commitd8a2007d477cea2174e20b49342d5feb0bfdb7ce (patch)
tree5bb8261a403fbd3da5564ff1a840b6752ee3cf7a /test/functional/api/server_requests_spec.lua
parent930ee40ad3c408c30d67147c9c3adaa635bb179f (diff)
parent8373aaf44e6a64dda135a11f275f4616afa23b63 (diff)
downloadrneovim-d8a2007d477cea2174e20b49342d5feb0bfdb7ce.tar.gz
rneovim-d8a2007d477cea2174e20b49342d5feb0bfdb7ce.tar.bz2
rneovim-d8a2007d477cea2174e20b49342d5feb0bfdb7ce.zip
Merge pull request #3869 from oni-link/fix.issue.3844
helpers.c: Handle msgpack str/bin objects with length 0 correctly
Diffstat (limited to 'test/functional/api/server_requests_spec.lua')
-rw-r--r--test/functional/api/server_requests_spec.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/functional/api/server_requests_spec.lua b/test/functional/api/server_requests_spec.lua
index a3ac864f79..16a4423535 100644
--- a/test/functional/api/server_requests_spec.lua
+++ b/test/functional/api/server_requests_spec.lua
@@ -32,6 +32,26 @@ describe('server -> client', function()
end)
end)
+ describe('empty string handling in arrays', function()
+ -- Because the msgpack encoding for an empty string was interpreted as an
+ -- error, msgpack arrays with an empty string looked like
+ -- [..., '', 0, ..., 0] after the conversion, regardless of the array
+ -- elements following the empty string.
+ it('works', function()
+ local function on_setup()
+ eq({1, 2, '', 3, 'asdf'}, eval('rpcrequest('..cid..', "nstring")'))
+ stop()
+ end
+
+ local function on_request(method, args)
+ -- No need to evaluate the args, we are only interested in
+ -- a response that contains an array with an empty string.
+ return {1, 2, '', 3, 'asdf'}
+ end
+ run(on_request, nil, on_setup)
+ end)
+ end)
+
describe('recursive call', function()
it('works', function()
local function on_setup()