summaryrefslogtreecommitdiff
path: root/test-beta
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-09-15 21:21:33 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-09-15 21:21:33 +0800
commit67159c6e5499ff4bbb34169d5ba8f0c89ed95198 (patch)
treeb1740d6d331c9626d3ed9b6bf06766236badf00f /test-beta
parentaae9cdb7ca5ecd749c1a64125faef2214baf066f (diff)
downloadlua-language-server-67159c6e5499ff4bbb34169d5ba8f0c89ed95198.zip
整理测试
Diffstat (limited to 'test-beta')
-rw-r--r--test-beta/signature/init.lua12
1 files changed, 5 insertions, 7 deletions
diff --git a/test-beta/signature/init.lua b/test-beta/signature/init.lua
index a2a647e7..6a6d4945 100644
--- a/test-beta/signature/init.lua
+++ b/test-beta/signature/init.lua
@@ -1,6 +1,5 @@
-local parser = require 'parser'
-local core = require 'core'
-local buildVM = require 'vm'
+local core = require 'core.signature'
+local files = require 'files'
rawset(_G, 'TEST', true)
@@ -8,10 +7,9 @@ function TEST(script)
return function (expect)
local pos = script:find('$', 1, true)
local new_script = script:gsub('%$', '')
- local ast = parser:parse(new_script, 'lua', 'Lua 5.3')
- local vm = buildVM(ast)
- assert(vm)
- local hovers = core.signature(vm, pos)
+ files.removeAll()
+ files.setText('', new_script)
+ local hovers = core('', pos)
if hovers then
assert(expect)
local hover = hovers[#hovers]