summaryrefslogtreecommitdiff
path: root/test/completion
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2022-01-23 04:37:55 +0800
committersumneko <sumneko@hotmail.com>2022-01-23 04:37:55 +0800
commit6c97dc8eaae16214a2127f84deca30f2ca6206a3 (patch)
tree7978bfe6dfd5ffc03b3e3228f1e57f43eb16deec /test/completion
parenta13a30f193b54f32138306463dd8e13d208fb45c (diff)
downloadlua-language-server-6c97dc8eaae16214a2127f84deca30f2ca6206a3.zip
fix #920
Diffstat (limited to 'test/completion')
-rw-r--r--test/completion/common.lua7
-rw-r--r--test/completion/init.lua12
2 files changed, 15 insertions, 4 deletions
diff --git a/test/completion/common.lua b/test/completion/common.lua
index b03d55ca..6affbc8f 100644
--- a/test/completion/common.lua
+++ b/test/completion/common.lua
@@ -3060,3 +3060,10 @@ local t
t:testFunc2(<??>)
]]
(EXISTS)
+
+TEST [[
+require '<??>'
+]]
+(function (results)
+ assert(#results == 11)
+end)
diff --git a/test/completion/init.lua b/test/completion/init.lua
index 1b2aaf2d..95da8890 100644
--- a/test/completion/init.lua
+++ b/test/completion/init.lua
@@ -110,11 +110,15 @@ function TEST(script)
end
assert(result)
result.complete = nil
- if expect.include then
- expect.include = nil
- assert(include(expect, result))
+ if type(expect) == 'function' then
+ expect(result)
else
- assert(eq(expect, result))
+ if expect.include then
+ expect.include = nil
+ assert(include(expect, result))
+ else
+ assert(eq(expect, result))
+ end
end
files.remove('')
end