diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2018-11-27 16:29:43 +0100 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-12-20 11:57:30 +0100 |
commit | e6d0dea42b28a4814546bcf699ce277c365ebfc1 (patch) | |
tree | a5dd79853c12837dfc35d001939f9ef947a6b75b /test/functional | |
parent | ccb005b9e0d509bbe595515e7e17b0e9713a2c19 (diff) | |
download | rneovim-e6d0dea42b28a4814546bcf699ce277c365ebfc1.tar.gz rneovim-e6d0dea42b28a4814546bcf699ce277c365ebfc1.tar.bz2 rneovim-e6d0dea42b28a4814546bcf699ce277c365ebfc1.zip |
test: Lua 5.2/5.3 compat #9280
Make the code run both on Lua 5.1 (which is the default for Neovim, and
is what LuaJIT provides) and Lua 5.2+.
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/api/server_requests_spec.lua | 1 | ||||
-rw-r--r-- | test/functional/api/tabpage_spec.lua | 1 | ||||
-rw-r--r-- | test/functional/api/window_spec.lua | 1 | ||||
-rw-r--r-- | test/functional/eval/function_spec.lua | 1 | ||||
-rw-r--r-- | test/functional/eval/server_spec.lua | 1 | ||||
-rw-r--r-- | test/functional/ex_cmds/dict_notifications_spec.lua | 1 | ||||
-rw-r--r-- | test/functional/helpers.lua | 1 | ||||
-rw-r--r-- | test/functional/legacy/autocmd_option_spec.lua | 1 | ||||
-rw-r--r-- | test/functional/ui/screen.lua | 1 | ||||
-rw-r--r-- | test/functional/ui/tabline_spec.lua | 1 |
10 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/api/server_requests_spec.lua b/test/functional/api/server_requests_spec.lua index 4d25ba0819..8de71a56e9 100644 --- a/test/functional/api/server_requests_spec.lua +++ b/test/functional/api/server_requests_spec.lua @@ -2,6 +2,7 @@ -- `rpcrequest` calls we need the client event loop to be running. local helpers = require('test.functional.helpers')(after_each) local Paths = require('test.config.paths') +local unpack = table.unpack or unpack -- luacheck: ignore local clear, nvim, eval = helpers.clear, helpers.nvim, helpers.eval local eq, neq, run, stop = helpers.eq, helpers.neq, helpers.run, helpers.stop diff --git a/test/functional/api/tabpage_spec.lua b/test/functional/api/tabpage_spec.lua index c49091db02..584bca7111 100644 --- a/test/functional/api/tabpage_spec.lua +++ b/test/functional/api/tabpage_spec.lua @@ -8,6 +8,7 @@ local request = helpers.request local NIL = helpers.NIL local meth_pcall = helpers.meth_pcall local command = helpers.command +local unpack = table.unpack or unpack -- luacheck: ignore describe('api/tabpage', function() before_each(clear) diff --git a/test/functional/api/window_spec.lua b/test/functional/api/window_spec.lua index 4496e1f644..273991951c 100644 --- a/test/functional/api/window_spec.lua +++ b/test/functional/api/window_spec.lua @@ -12,6 +12,7 @@ local meth_pcall = helpers.meth_pcall local meths = helpers.meths local command = helpers.command local expect_err = helpers.expect_err +local unpack = table.unpack or unpack -- luacheck: ignore -- check if str is visible at the beginning of some line local function is_visible(str) diff --git a/test/functional/eval/function_spec.lua b/test/functional/eval/function_spec.lua index 776e760aaf..1a86576fde 100644 --- a/test/functional/eval/function_spec.lua +++ b/test/functional/eval/function_spec.lua @@ -1,4 +1,5 @@ local helpers = require('test.functional.helpers')(after_each) +local unpack = table.unpack or unpack -- luacheck: ignore local clear = helpers.clear local eq = helpers.eq diff --git a/test/functional/eval/server_spec.lua b/test/functional/eval/server_spec.lua index 563e619b39..8a0831bba1 100644 --- a/test/functional/eval/server_spec.lua +++ b/test/functional/eval/server_spec.lua @@ -6,6 +6,7 @@ local iswin = helpers.iswin local ok = helpers.ok local matches = helpers.matches local expect_err = helpers.expect_err +local unpack = table.unpack or unpack -- luacheck: ignore local function clear_serverlist() for _, server in pairs(funcs.serverlist()) do diff --git a/test/functional/ex_cmds/dict_notifications_spec.lua b/test/functional/ex_cmds/dict_notifications_spec.lua index 3d550588e7..f5920c3d11 100644 --- a/test/functional/ex_cmds/dict_notifications_spec.lua +++ b/test/functional/ex_cmds/dict_notifications_spec.lua @@ -4,6 +4,7 @@ local eq, next_msg = helpers.eq, helpers.next_msg local exc_exec = helpers.exc_exec local command = helpers.command local eval = helpers.eval +local unpack = table.unpack or unpack -- luacheck: ignore describe('dictionary change notifications', function() diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index a94e977cd0..7921cc05bf 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -2,6 +2,7 @@ require('coxpcall') local luv = require('luv') local lfs = require('lfs') local global_helpers = require('test.helpers') +local unpack = table.unpack or unpack -- luacheck: ignore -- nvim client: Found in .deps/usr/share/lua/<version>/nvim/ if "bundled". local Session = require('nvim.session') diff --git a/test/functional/legacy/autocmd_option_spec.lua b/test/functional/legacy/autocmd_option_spec.lua index 0c7e43bf31..de0e32c813 100644 --- a/test/functional/legacy/autocmd_option_spec.lua +++ b/test/functional/legacy/autocmd_option_spec.lua @@ -5,6 +5,7 @@ local curbuf, buf = helpers.curbuf, helpers.bufmeths local curwin = helpers.curwin local redir_exec = helpers.redir_exec local source, command = helpers.source, helpers.command +local unpack = table.unpack or unpack -- luacheck: ignore local function declare_hook_function() source([[ diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 75eb5bb4e3..32a8e69511 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -78,6 +78,7 @@ local helpers = require('test.functional.helpers')(nil) local request, run, uimeths = helpers.request, helpers.run, helpers.uimeths local eq = helpers.eq local dedent = helpers.dedent +local unpack = table.unpack or unpack -- luacheck: ignore local inspect = require('inspect') diff --git a/test/functional/ui/tabline_spec.lua b/test/functional/ui/tabline_spec.lua index dcab9f7ef4..ac56a7c03f 100644 --- a/test/functional/ui/tabline_spec.lua +++ b/test/functional/ui/tabline_spec.lua @@ -1,6 +1,7 @@ local helpers = require('test.functional.helpers')(after_each) local Screen = require('test.functional.ui.screen') local clear, command, eq = helpers.clear, helpers.command, helpers.eq +local unpack = table.unpack or unpack -- luacheck: ignore describe('ui/ext_tabline', function() local screen |