summaryrefslogtreecommitdiff
path: root/server-beta/test/full
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-10-22 14:46:29 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-10-22 14:46:29 +0800
commit7e10ca9e3f60c5a108ee3d9bccf9c42da3d74c02 (patch)
tree0f2cb64c98379382483a339f1ac31bc889d057f4 /server-beta/test/full
parent6ff3fcc8a106a3429e5bf7dfd4ca6db5a3cc3e1c (diff)
downloadlua-language-server-7e10ca9e3f60c5a108ee3d9bccf9c42da3d74c02.zip
修改预读流程
Diffstat (limited to 'server-beta/test/full')
-rw-r--r--server-beta/test/full/example.lua11
-rw-r--r--server-beta/test/full/init.lua7
2 files changed, 6 insertions, 12 deletions
diff --git a/server-beta/test/full/example.lua b/server-beta/test/full/example.lua
index a096f83d..670bfe64 100644
--- a/server-beta/test/full/example.lua
+++ b/server-beta/test/full/example.lua
@@ -1,12 +1,9 @@
-local fs = require 'bee.filesystem'
-local core = require 'core'
+local util = require 'utility'
local parser = require 'parser'
-TEST(io.load(ROOT / 'src' / 'vm' / 'vm.lua'))
-
-- 临时
local function testIfExit(path)
- local buf = io.load(fs.path(path))
+ local buf = util.loadFile(path:string())
if buf then
local vm
@@ -26,9 +23,9 @@ local function testIfExit(path)
local clock = os.clock()
local max = 100
local need
- local lines = parser:lines(buf, 'utf8')
+ local lines = parser:lines(buf)
for i = 1, max do
- core.diagnostics(vm, lines, 'test')
+ --core.diagnostics(vm, lines, 'test')
local passed = os.clock() - clock
if passed >= 1.0 or i == max then
need = passed / i
diff --git a/server-beta/test/full/init.lua b/server-beta/test/full/init.lua
index 3d0661cb..f370671e 100644
--- a/server-beta/test/full/init.lua
+++ b/server-beta/test/full/init.lua
@@ -1,14 +1,11 @@
-local buildVM = require 'vm'
local parser = require 'parser'
rawset(_G, 'TEST', true)
function TEST(script)
- local ast = parser:parse(script, 'lua', 'Lua 5.3')
+ local ast = parser:compile(script, 'lua', 'Lua 5.3')
assert(ast)
- local vm, err = buildVM(ast)
- assert(vm, err)
- return vm
+ return ast
end
require 'full.normal'