summaryrefslogtreecommitdiff
path: root/test/other/ver.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-03-24 13:57:52 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-03-24 13:57:52 +0800
commit526d262770d4b0182a8dfd5961fbc965e93bbc53 (patch)
tree423a6c6cff72713b4f67900e1a05c4d2d16f374b /test/other/ver.lua
parentb43cbe27152785d21ae4bb54265c345f85183940 (diff)
downloadlua-language-server-526d262770d4b0182a8dfd5961fbc965e93bbc53.zip
测试时检查二进制版本与arch
Diffstat (limited to 'test/other/ver.lua')
-rw-r--r--test/other/ver.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/other/ver.lua b/test/other/ver.lua
new file mode 100644
index 00000000..83abcb26
--- /dev/null
+++ b/test/other/ver.lua
@@ -0,0 +1,27 @@
+local platform = require 'bee.platform'
+
+assert(_VERSION == 'Lua 5.4', '必须是 Lua 5.4')
+
+local arch = (function()
+ if string.packsize then
+ local size = string.packsize "T"
+ if size == 8 then
+ return 64
+ end
+ if size == 4 then
+ return 32
+ end
+ else
+ if platform ~= "windows" then
+ return 64
+ end
+ local size = #tostring(io.stderr)
+ if size <= 15 then
+ return 32
+ end
+ return 64
+ end
+ assert(false, "unknown arch")
+end)()
+
+assert(arch == 64, '必须是 x84_64')