summaryrefslogtreecommitdiff
path: root/server-beta/test/references/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-11-11 19:31:04 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-11-11 19:31:04 +0800
commit91af49cdfd292b7e479e6e0327d04c436256ed7b (patch)
tree20c15d08d5db62e95505b9895bb15cdf01c58a1c /server-beta/test/references/init.lua
parent8f5bc53c9fd5d289cf82e5dfb55a8e9912fb8e82 (diff)
downloadlua-language-server-91af49cdfd292b7e479e6e0327d04c436256ed7b.zip
过单文件 reference 测试
Diffstat (limited to 'server-beta/test/references/init.lua')
-rw-r--r--server-beta/test/references/init.lua19
1 files changed, 14 insertions, 5 deletions
diff --git a/server-beta/test/references/init.lua b/server-beta/test/references/init.lua
index e66449fb..e009ee19 100644
--- a/server-beta/test/references/init.lua
+++ b/server-beta/test/references/init.lua
@@ -34,10 +34,10 @@ end
function TEST(script)
files.removeAll()
local target = catch_target(script)
- local start = script:find('<?', 1, true)
- local finish = script:find('?>', 1, true)
+ local start = script:find('<[?~]')
+ local finish = script:find('[?~]>')
local pos = (start + finish) // 2 + 1
- local new_script = script:gsub('<[!?]', ' '):gsub('[!?]>', ' ')
+ local new_script = script:gsub('<[!?~]', ' '):gsub('[!?~]>', ' ')
files.setText('', new_script)
local results = core('', pos)
@@ -92,14 +92,23 @@ end
TEST [[
local function f()
- return <?function ()
- end?>
+ return <~<!function~> ()
+ end!>
end
local <!f2!> = f()
]]
TEST [[
+local function f()
+ return nil, <~<!function~> ()
+ end!>
+end
+
+local _, <!f2!> = f()
+]]
+
+TEST [[
table.<!dump!>()
function table.<?dump?>()
end