diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-09-22 23:44:21 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-09-22 23:44:21 +0800 |
commit | c2a8838012780eb57fa7de36ae0cfa6fd4388b96 (patch) | |
tree | 5dc42d4cd3bb32628a9c4f3b9c5bac7dc9d01171 /test/code_action | |
parent | b6f99a71289f37e3c473a43d0a5290866a0822eb (diff) | |
download | lua-language-server-c2a8838012780eb57fa7de36ae0cfa6fd4388b96.zip |
update
Diffstat (limited to 'test/code_action')
-rw-r--r-- | test/code_action/init.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/code_action/init.lua b/test/code_action/init.lua index 11ce6ec7..70d8c9ec 100644 --- a/test/code_action/init.lua +++ b/test/code_action/init.lua @@ -1,6 +1,7 @@ local core = require 'core.code-action' local files = require 'files' local lang = require 'language' +local catch = require 'catch' rawset(_G, 'TEST', true) @@ -38,11 +39,10 @@ end function TEST(script) return function (expect) files.removeAll() - local start = script:find('<?', 1, true) - local finish = script:find('?>', 1, true) - local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ') - files.setText('', new_script) - local results = core('', start, finish) + + local newScript, catched = catch(script, '?') + files.setText('', newScript) + local results = core('', catched['?'][1][1], catched['?'][1][2]) assert(results) assert(eq(expect, results)) end |