From 7e10ca9e3f60c5a108ee3d9bccf9c42da3d74c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 22 Oct 2019 14:46:29 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=AF=BB=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server-beta/test/full/example.lua | 11 ++++------- server-beta/test/full/init.lua | 7 ++----- 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'server-beta/test/full') 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' -- cgit v1.2.3