summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/diagnostics/common.lua47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/diagnostics/common.lua b/test/diagnostics/common.lua
index 759039a6..5e65b410 100644
--- a/test/diagnostics/common.lua
+++ b/test/diagnostics/common.lua
@@ -87,6 +87,15 @@ X = [=[
]]
TEST [[
+-- xxxx
+]]
+
+TEST [[
+-- [=[
+ ]=]
+]]
+
+TEST [[
local x
print(x)
local <!x!>
@@ -1695,3 +1704,41 @@ function t:init() end
TEST [[
return function f(x, y, z) end
]]
+
+util.arrayInsert(disables, 'redundant-return')
+TEST [[
+---@return number
+function F()
+ <!return!>
+end
+]]
+
+TEST [[
+---@return number, number
+function F()
+ <!return!> 1
+end
+]]
+
+TEST [[
+---@return number, number?
+function F()
+ return 1
+end
+]]
+
+do return end
+TEST [[
+---@return number
+function F()
+ X = 1<!!>
+end
+]]
+
+TEST [[
+---@return number, number?
+function F()
+ return 1, 1, <!1!>
+end
+]]
+util.arrayRemove(disables, 'redundant-return')