summaryrefslogtreecommitdiff
path: root/server/test
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-10 20:32:51 +0800
committersumneko <sumneko@hotmail.com>2019-04-10 20:32:51 +0800
commitcf5c0eaeb60c5610e7b9fe34f1d2df1376cb856d (patch)
tree009b7f0896c6d60654a153e3297141df45a9b597 /server/test
parentce9e8a5033dd9ea9bfd2bb2c53af0906e638db28 (diff)
downloadlua-language-server-cf5c0eaeb60c5610e7b9fe34f1d2df1376cb856d.zip
穿透pcall与xpcall
Diffstat (limited to 'server/test')
-rw-r--r--server/test/hover/init.lua40
1 files changed, 40 insertions, 0 deletions
diff --git a/server/test/hover/init.lua b/server/test/hover/init.lua
index b144fd72..3d82777d 100644
--- a/server/test/hover/init.lua
+++ b/server/test/hover/init.lua
@@ -401,3 +401,43 @@ local sssss<utf8>: {
offset: function,
}
]]
+
+TEST[[
+function a(v)
+ print(<?v?>)
+end
+a(1)
+]]
+[[
+local v: number = 1
+]]
+
+TEST[[
+function a(v)
+ print(<?v?>)
+end
+pcall(a, 1)
+]]
+[[
+local v: number = 1
+]]
+
+TEST[[
+function a(v)
+ print(<?v?>)
+end
+xpcall(a, log.error, 1)
+]]
+[[
+local v: number = 1
+]]
+
+TEST[[
+function a(v)
+ return 'a'
+end
+local _, <?r?> = pcall(a, 1)
+]]
+[[
+local r: string = "a"
+]]