diff -Nru lua-nvim-0.0.1-26/debian/changelog lua-nvim-0.1.0-1/debian/changelog --- lua-nvim-0.0.1-26/debian/changelog 2018-05-14 21:15:26.000000000 +0000 +++ lua-nvim-0.1.0-1/debian/changelog 2018-06-12 00:44:29.000000000 +0000 @@ -1,3 +1,11 @@ +lua-nvim (0.1.0-1-1) unstable; urgency=medium + + * New upstream release + + Handle stream errors before acting on the stream (Closes: #900650) + + test: Accept new/old error messages for invalid rpcrequest() syntax + + -- Jason Pleau Mon, 11 Jun 2018 20:44:29 -0400 + lua-nvim (0.0.1-26-3) unstable; urgency=medium * Update Vcs-* Fields diff -Nru lua-nvim-0.0.1-26/Makefile lua-nvim-0.1.0-1/Makefile --- lua-nvim-0.0.1-26/Makefile 2017-04-26 00:04:26.000000000 +0000 +++ lua-nvim-0.1.0-1/Makefile 2018-06-10 13:25:47.000000000 +0000 @@ -1,14 +1,12 @@ -# This Makefile's only purpose is to simplify creating/maintaining a -# development environment. It will setup a project-private prefix(.deps/usr) -# with all dependencies required for building/testing -# -# local.mk is ignored by git and can be used for developer-specific -# customizations, which can be: -# - override default target -# - define custom targets -# - override ovariables defined here(all variables are defined with ?=) +# This Makefile creates a project-private prefix ".deps/usr" with all +# dependencies required for building/testing. + +# local.mk is ignored by git, use it for local build settings. -include local.mk +# Use TEST_TAG=foo to pass --tags=foo to busted. +_TEST_TAG := $(if $(TEST_TAG),--tags=$(TEST_TAG),) + # Dependencies prefix DEPS_DIR ?= $(shell pwd)/.deps DEPS_PREFIX ?= $(DEPS_DIR)/usr @@ -47,7 +45,8 @@ deps: | $(MPACK) $(COXPCALL) $(BUSTED) $(LUV) test: all - $(BUSTED) -v '--lpath=./nvim/?.lua;' '--cpath=./nvim/?.so;' -o gtest test + NVIM_LOG_FILE=nvimlog $(BUSTED) -v $(_TEST_TAG) \ + '--lpath=./nvim/?.lua;' '--cpath=./nvim/?.so;' -o gtest test valgrind: all eval $$($(LUAROCKS) path); \ diff -Nru lua-nvim-0.0.1-26/nvim/socket_stream.lua lua-nvim-0.1.0-1/nvim/socket_stream.lua --- lua-nvim-0.0.1-26/nvim/socket_stream.lua 2017-04-26 00:04:26.000000000 +0000 +++ lua-nvim-0.1.0-1/nvim/socket_stream.lua 2018-06-10 13:25:47.000000000 +0000 @@ -16,6 +16,9 @@ end function SocketStream:write(data) + if self._stream_error then + error(self._stream_error) + end uv.write(self._socket, data, function(err) if err then error(self._stream_error or err) @@ -24,6 +27,9 @@ end function SocketStream:read_start(cb) + if self._stream_error then + error(self._stream_error) + end uv.read_start(self._socket, function(err, chunk) if err then error(err) @@ -33,6 +39,9 @@ end function SocketStream:read_stop() + if self._stream_error then + error(self._stream_error) + end uv.read_stop(self._socket) end diff -Nru lua-nvim-0.0.1-26/nvim/tcp_stream.lua lua-nvim-0.1.0-1/nvim/tcp_stream.lua --- lua-nvim-0.0.1-26/nvim/tcp_stream.lua 2017-04-26 00:04:26.000000000 +0000 +++ lua-nvim-0.1.0-1/nvim/tcp_stream.lua 2018-06-10 13:25:47.000000000 +0000 @@ -16,6 +16,9 @@ end function TcpStream:write(data) + if self._stream_error then + error(self._stream_error) + end uv.write(self._socket, data, function(err) if err then error(self._stream_error or err) @@ -24,6 +27,9 @@ end function TcpStream:read_start(cb) + if self._stream_error then + error(self._stream_error) + end uv.read_start(self._socket, function(err, chunk) if err then error(err) @@ -33,6 +39,9 @@ end function TcpStream:read_stop() + if self._stream_error then + error(self._stream_error) + end uv.read_stop(self._socket) end diff -Nru lua-nvim-0.0.1-26/nvim-client-0.0.1-26.rockspec lua-nvim-0.1.0-1/nvim-client-0.0.1-26.rockspec --- lua-nvim-0.0.1-26/nvim-client-0.0.1-26.rockspec 2017-04-26 00:04:26.000000000 +0000 +++ lua-nvim-0.1.0-1/nvim-client-0.0.1-26.rockspec 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -package = 'nvim-client' -version = '0.0.1-26' -source = { - url = 'https://github.com/neovim/lua-client/archive/' .. version .. '.tar.gz', - dir = 'lua-client-' .. version, -} -description = { - summary = 'Lua client to Nvim', - license = 'Apache' -} -dependencies = { - 'lua >= 5.1', - 'mpack', - 'luv', - 'coxpcall' -} - -local function make_modules() - return { - ['nvim.socket_stream'] = 'nvim/socket_stream.lua', - ['nvim.tcp_stream'] = 'nvim/tcp_stream.lua', - ['nvim.stdio_stream'] = 'nvim/stdio_stream.lua', - ['nvim.child_process_stream'] = 'nvim/child_process_stream.lua', - ['nvim.msgpack_rpc_stream'] = 'nvim/msgpack_rpc_stream.lua', - ['nvim.session'] = 'nvim/session.lua', - ['nvim.native'] = { - sources = {'nvim/native.c'} - } - } -end - -build = { - type = 'builtin', - modules = make_modules(), -} diff -Nru lua-nvim-0.0.1-26/nvim-client-0.1.0-1.rockspec lua-nvim-0.1.0-1/nvim-client-0.1.0-1.rockspec --- lua-nvim-0.0.1-26/nvim-client-0.1.0-1.rockspec 1970-01-01 00:00:00.000000000 +0000 +++ lua-nvim-0.1.0-1/nvim-client-0.1.0-1.rockspec 2018-06-10 13:25:47.000000000 +0000 @@ -0,0 +1,35 @@ +package = 'nvim-client' +version = '0.1.0-1' +source = { + url = 'https://github.com/neovim/lua-client/archive/' .. version .. '.tar.gz', + dir = 'lua-client-' .. version, +} +description = { + summary = 'Lua client to Nvim', + license = 'Apache' +} +dependencies = { + 'lua >= 5.1', + 'mpack', + 'luv', + 'coxpcall' +} + +local function make_modules() + return { + ['nvim.socket_stream'] = 'nvim/socket_stream.lua', + ['nvim.tcp_stream'] = 'nvim/tcp_stream.lua', + ['nvim.stdio_stream'] = 'nvim/stdio_stream.lua', + ['nvim.child_process_stream'] = 'nvim/child_process_stream.lua', + ['nvim.msgpack_rpc_stream'] = 'nvim/msgpack_rpc_stream.lua', + ['nvim.session'] = 'nvim/session.lua', + ['nvim.native'] = { + sources = {'nvim/native.c'} + } + } +end + +build = { + type = 'builtin', + modules = make_modules(), +} diff -Nru lua-nvim-0.0.1-26/README.md lua-nvim-0.1.0-1/README.md --- lua-nvim-0.0.1-26/README.md 2017-04-26 00:04:26.000000000 +0000 +++ lua-nvim-0.1.0-1/README.md 2018-06-10 13:25:47.000000000 +0000 @@ -4,3 +4,25 @@ [![Build Status](https://travis-ci.org/neovim/lua-client.svg?branch=master)](https://travis-ci.org/neovim/lua-client) Lua client for Neovim + +Build +----- + +The `Makefile` pulls and builds various dependencies into `.deps`. + + make + +Test +---- + +Run tests against whatever `nvim` is in `$PATH`: + + make test + +Use a specific `nvim`: + + NVIM_PROG=/path/to/nvim make test + +Use test tags (`it('#foo', function() ...`): + + NVIM_PROG=/path/to/nvim make test TEST_TAG=foo diff -Nru lua-nvim-0.0.1-26/test/session_spec.lua lua-nvim-0.1.0-1/test/session_spec.lua --- lua-nvim-0.0.1-26/test/session_spec.lua 2017-04-26 00:04:26.000000000 +0000 +++ lua-nvim-0.1.0-1/test/session_spec.lua 2018-06-10 13:25:47.000000000 +0000 @@ -118,7 +118,13 @@ local status, result = session:request('vim_eval', string.format('rpcrequest(%d, "method", 1, 2', channel_id)) assert.is_false(status) - assert.are.equal('Failed to evaluate expression', result[2]) + -- Improved parsing in nvim changed the error message between 0.2.2 and + -- 0.3.0, but accept either to ease transition between versions + if string.match(result[2], 'Failed') then + assert.are.equal('Failed to evaluate expression', result[2]) + else + assert.are.equal('Vim:E116: Invalid arguments for function rpcrequest', result[2]) + end end) it('can break out of event loop with a timeout', function()