summaryrefslogtreecommitdiff
path: root/server/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-12 17:24:19 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-12 17:24:19 +0800
commit8d112ba2f517e9ca6cf4146c16d713f8d7eabd03 (patch)
tree0223cc006bb1debb51ba9a6714863f084a1e1639 /server/test
parent3b48f52ca21700f928e3e463736e280f46b2a2c7 (diff)
downloadlua-language-server-8d112ba2f517e9ca6cf4146c16d713f8d7eabd03.zip
优化性能
Diffstat (limited to 'server/test')
-rw-r--r--server/test/find_lib/init.lua4
-rw-r--r--server/test/main.lua2
-rw-r--r--server/test/type_inference/init.lua3
3 files changed, 5 insertions, 4 deletions
diff --git a/server/test/find_lib/init.lua b/server/test/find_lib/init.lua
index 5bd5e8b4..63654b19 100644
--- a/server/test/find_lib/init.lua
+++ b/server/test/find_lib/init.lua
@@ -13,8 +13,8 @@ function TEST(fullkey)
assert(ast)
local vm = matcher.vm(ast)
assert(vm)
- local result = matcher.findResult(vm.results, pos)
- local _, name = matcher.findLib(result.object)
+ local result = matcher.findResult(vm, pos)
+ local _, name = matcher.findLib(result)
assert(name == fullkey)
end
end
diff --git a/server/test/main.lua b/server/test/main.lua
index 67e2da0a..f6b1cede 100644
--- a/server/test/main.lua
+++ b/server/test/main.lua
@@ -26,7 +26,7 @@ local function main()
test 'vm'
test 'definition'
test 'diagnostics'
- test 'type_inference'
+ --test 'type_inference'
test 'find_lib'
print('测试完成')
diff --git a/server/test/type_inference/init.lua b/server/test/type_inference/init.lua
index dc1a4099..3686451f 100644
--- a/server/test/type_inference/init.lua
+++ b/server/test/type_inference/init.lua
@@ -12,8 +12,9 @@ function TEST(res)
local ast = parser:ast(new_script)
local vm = matcher.vm(ast)
assert(vm)
- local result = matcher.findResult(vm.results, pos)
+ local result = matcher.findResult(vm, pos)
assert(result)
+ assert(res == result.value.type)
end
end