summaryrefslogtreecommitdiff
path: root/server/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-12-12 14:05:17 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-12-12 14:05:17 +0800
commita0dad951f50e877c9ffaabc71ea09f708231f3a2 (patch)
tree32d168a74cb0e9ff3dd89f4bca9a4d01699c92be /server/test
parent45fbe47a30a18d81c121dc71f9e20355f33765ca (diff)
downloadlua-language-server-a0dad951f50e877c9ffaabc71ea09f708231f3a2.zip
vm支持require库
Diffstat (limited to 'server/test')
-rw-r--r--server/test/find_lib/init.lua12
-rw-r--r--server/test/main.lua2
2 files changed, 5 insertions, 9 deletions
diff --git a/server/test/find_lib/init.lua b/server/test/find_lib/init.lua
index 26dbc893..31d44dfc 100644
--- a/server/test/find_lib/init.lua
+++ b/server/test/find_lib/init.lua
@@ -11,14 +11,10 @@ function TEST(fullkey)
local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ')
local ast = parser:ast(new_script)
assert(ast)
- local results = matcher.compile(ast)
- assert(results)
- local result = matcher.findResult(results, pos)
- assert(result)
- assert(result.type == 'var')
- local var = result.var
- assert(var)
- local _, name = matcher.findLib(var)
+ local vm = matcher.vm(ast)
+ assert(vm)
+ local result = matcher.findResult(vm.results, pos)
+ local _, name = matcher.findLib(result.object)
assert(name == fullkey)
end
end
diff --git a/server/test/main.lua b/server/test/main.lua
index 8e340157..690c8d3c 100644
--- a/server/test/main.lua
+++ b/server/test/main.lua
@@ -27,7 +27,7 @@ local function main()
--test 'type_inference'
test 'definition'
test 'diagnostics'
- --test 'find_lib'
+ test 'find_lib'
print('测试完成')
end