summaryrefslogtreecommitdiff
path: root/test/diagnostics
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-22 03:18:35 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-22 03:18:35 +0800
commit7881d1a3d91b59d2dd8c28a72453e0e6c44a902f (patch)
tree6c2466f3676d813ac9db469815f4af9834d1711a /test/diagnostics
parentb85ff57a116fb252a0da35e525264e0940af88c7 (diff)
downloadlua-language-server-7881d1a3d91b59d2dd8c28a72453e0e6c44a902f.zip
new diagnostic `missing-parameter`
Diffstat (limited to 'test/diagnostics')
-rw-r--r--test/diagnostics/common.lua44
1 files changed, 41 insertions, 3 deletions
diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua
index e6808784..b8d0bcd8 100644
--- a/test/diagnostics/common.lua
+++ b/test/diagnostics/common.lua
@@ -163,7 +163,7 @@ print()
]]
TEST [[
-pairs
+print
{}
{}
]]
@@ -242,6 +242,44 @@ m:x(1, <!2!>, <!3!>, <!4!>)
]]
TEST [[
+local function x(a, b)
+ return a, b
+end
+<!x(1)!>
+]]
+
+TEST [[
+local function x(a, b, ...)
+ return a, b, ...
+end
+x(1, 2)
+]]
+
+TEST [[
+---@param b? integer
+local function x(a, b)
+ return a, b
+end
+x(1)
+]]
+
+TEST [[
+---@param b integer?
+local function x(a, b)
+ return a, b
+end
+x(1)
+]]
+
+TEST [[
+---@param b integer|nil
+local function x(a, b)
+ return a, b
+end
+x(1)
+]]
+
+TEST [[
local m = {}
function m.x()
end
@@ -1383,13 +1421,13 @@ TEST [[
]]
TEST [[
-return ('1'):gsub()
+return ('1'):upper()
]]
TEST [[
local value
value = '1'
-value = value:gsub()
+value = value:upper()
]]
TEST [[