summaryrefslogtreecommitdiff
path: root/test/diagnostics/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/diagnostics/init.lua')
-rw-r--r--test/diagnostics/init.lua37
1 files changed, 34 insertions, 3 deletions
diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua
index ab55cd92..a46a6dd7 100644
--- a/test/diagnostics/init.lua
+++ b/test/diagnostics/init.lua
@@ -6,6 +6,7 @@ local catch = require 'catch'
config.get 'Lua.diagnostics.neededFileStatus'['deprecated'] = 'Any'
config.get 'Lua.diagnostics.neededFileStatus'['type-check'] = 'Any'
+config.get 'Lua.diagnostics.neededFileStatus'['await-in-sync'] = 'Any'
rawset(_G, 'TEST', true)
@@ -25,6 +26,7 @@ local function founded(targets, results)
return true
end
+---@diagnostic disable: await-in-sync
function TEST(script, ...)
files.removeAll()
local newScript, catched = catch(script, '!')
@@ -1348,12 +1350,41 @@ end
f()
]]
----TODO(arthur)
-do return end
-
TEST [[
---@type file*
local f
f:read '*a'
f:read('*a')
]]
+
+TEST [[
+function F()
+ <!coroutine.yield!>()
+end
+]]
+
+TEST [[
+---@async
+function F()
+ coroutine.yield()
+end
+]]
+
+TEST [[
+---@type async fun()
+local f
+
+function F()
+ <!f!>()
+end
+]]
+
+TEST [[
+---@type async fun()
+local f
+
+---@async
+function F()
+ f()
+end
+]]