summaryrefslogtreecommitdiff
path: root/server-beta/test/definition/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server-beta/test/definition/init.lua')
-rw-r--r--server-beta/test/definition/init.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/server-beta/test/definition/init.lua b/server-beta/test/definition/init.lua
index f2c68f14..4e2d9de5 100644
--- a/server-beta/test/definition/init.lua
+++ b/server-beta/test/definition/init.lua
@@ -1,6 +1,5 @@
local core = require 'core.definition'
-local engineer = require 'core.engineer'
-local parser = require 'parser'
+local files = require 'files'
rawset(_G, 'TEST', true)
@@ -35,15 +34,15 @@ local function founded(targets, results)
end
function TEST(script)
+ files.removeAll()
local target = catch_target(script)
local start = script:find('<?', 1, true)
local finish = script:find('?>', 1, true)
local pos = (start + finish) // 2 + 1
local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ')
- local ast = parser:compile(new_script, 'lua', 'Lua 5.3')
- assert(ast)
+ files.setText('', new_script)
- local results = core(ast, pos)
+ local results = core('', pos)
if results then
local positions = {}
for i, result in ipairs(results) do