summaryrefslogtreecommitdiff
path: root/server-beta/test/diagnostics
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-11-05 19:31:38 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-11-05 19:31:38 +0800
commitc844e46ae97f28ec928db6b701fdf5f2eea2664d (patch)
tree938d77a0aadb6a3975d146659302137f58d9babc /server-beta/test/diagnostics
parent5d4d2ccd06d56bb92219baf3825c5786efdf906c (diff)
downloadlua-language-server-c844e46ae97f28ec928db6b701fdf5f2eea2664d.zip
更新诊断实现
Diffstat (limited to 'server-beta/test/diagnostics')
-rw-r--r--server-beta/test/diagnostics/init.lua47
1 files changed, 47 insertions, 0 deletions
diff --git a/server-beta/test/diagnostics/init.lua b/server-beta/test/diagnostics/init.lua
index 680d6bf6..2970938d 100644
--- a/server-beta/test/diagnostics/init.lua
+++ b/server-beta/test/diagnostics/init.lua
@@ -210,6 +210,44 @@ x(1, 2, <!3!>)
]]
TEST [[
+local function x(a, b, ...)
+ return a, b, ...
+end
+x(1, 2, 3, 4, 5)
+]]
+
+TEST [[
+local m = {}
+function m:x(a, b)
+ return a, b
+end
+m:x(1, 2, <!3!>)
+]]
+
+TEST [[
+local m = {}
+function m:x(a, b)
+ return a, b
+end
+m.x(1, 2, 3, <!4!>)
+]]
+
+TEST [[
+local m = {}
+function m.x(a, b)
+ return a, b
+end
+m:x(1, <!2!>, <!3!>, <!4!>)
+]]
+
+TEST [[
+local m = {}
+function m.x()
+end
+m:x()
+]]
+
+TEST [[
InstanceName = 1
Instance = _G[InstanceName]
]]
@@ -224,18 +262,27 @@ return [[
]]
]=]
+config.config.diagnostics.disable['unused-function'] = true
TEST [[
local mt, x
function mt:m()
function x:m()
end
end
+return mt, x
]]
TEST [[
local mt = {}
function mt:f()
end
+return mt
+]]
+
+TEST [[
+local <!mt!> = {}
+function mt:f()
+end
]]
TEST [[