From 19dd94e4af06254595a949a61c9bd05c5a911328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 5 Dec 2020 22:02:19 +0800 Subject: stash --- test/code_action/init.lua | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 test/code_action/init.lua (limited to 'test') diff --git a/test/code_action/init.lua b/test/code_action/init.lua new file mode 100644 index 00000000..d3b2d768 --- /dev/null +++ b/test/code_action/init.lua @@ -0,0 +1,36 @@ +local core = require 'core.code-action' +local files = require 'files' +local lang = require 'language' + +rawset(_G, 'TEST', true) + +function TEST(script) + return function (expect) + files.removeAll() + local start = script:find('', 1, true) + local pos = (start + finish) // 2 + 1 + local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ') + files.setText('', new_script) + local results = core('', pos) + assert(results) + assert(expect == results) + end +end + +TEST [[ +print(, b, c) +]] +{ + { + title = lang.script.ACTION_SWAP_PARAMS, + kind = 'refactor.rewrite', + edit = { + change = { + ['file:///.lua'] = { + + } + } + } + } +} -- cgit v1.2.3