summaryrefslogtreecommitdiff
path: root/test/code_action/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/code_action/init.lua')
-rw-r--r--test/code_action/init.lua10
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