aboutsummaryrefslogtreecommitdiff
path: root/test/compat.lua
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-10-11 19:00:52 +0000
committerJosh Rahm <rahm@google.com>2022-10-11 19:00:52 +0000
commit21e2e46242033c7aaa6ccfb23e256680816c063c (patch)
treef089522cfb145d6e9c8a86a01d8e454ce5501e20 /test/compat.lua
parent179d3ed87b17988f5fe00d8b99f2611a28212be7 (diff)
parent760b399f6c0c6470daa0663752bd22886997f9e6 (diff)
downloadrneovim-floattitle.tar.gz
rneovim-floattitle.tar.bz2
rneovim-floattitle.zip
Merge remote-tracking branch 'upstream/master' into floattitlefloattitle
Diffstat (limited to 'test/compat.lua')
-rw-r--r--test/compat.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/compat.lua b/test/compat.lua
new file mode 100644
index 0000000000..2c9786d491
--- /dev/null
+++ b/test/compat.lua
@@ -0,0 +1,12 @@
+-- Lua 5.1 forward-compatibility layer.
+-- For background see https://github.com/neovim/neovim/pull/9280
+--
+-- Reference the lua-compat-5.2 project for hints:
+-- https://github.com/keplerproject/lua-compat-5.2/blob/c164c8f339b95451b572d6b4b4d11e944dc7169d/compat52/mstrict.lua
+-- https://github.com/keplerproject/lua-compat-5.2/blob/c164c8f339b95451b572d6b4b4d11e944dc7169d/tests/test.lua
+
+local lua_version = _VERSION:sub(-3)
+
+if lua_version >= '5.2' then
+ unpack = table.unpack -- luacheck: ignore 121 143
+end