diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-14 17:48:57 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-14 17:48:57 +0800 |
commit | 4f33ceec00032028c5cc47a00c1ec869902061a8 (patch) | |
tree | 0fa2b9688bf4b860c78f0832ea5d3938c4aadc89 /server/test/hover/init.lua | |
parent | 8cde753ce395356a87db21221a90de60eb13be5a (diff) | |
download | lua-language-server-4f33ceec00032028c5cc47a00c1ec869902061a8.zip |
支持多类型
Diffstat (limited to 'server/test/hover/init.lua')
-rw-r--r-- | server/test/hover/init.lua | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/server/test/hover/init.lua b/server/test/hover/init.lua index 348b5c8c..870b4dc1 100644 --- a/server/test/hover/init.lua +++ b/server/test/hover/init.lua @@ -14,8 +14,8 @@ function TEST(script) assert(vm) local result = matcher.hover(vm, pos) assert(result) - expect = expect:gsub('^[\r\n]*(.-)[\r\n]*$', '%1') - result = result:gsub('```lua', ''):gsub('```', ''):gsub('^[\r\n]*(.-)[\r\n]*$', '%1') + expect = expect:gsub('^[\r\n]*(.-)[\r\n]*$', '%1'):gsub('\r\n', '\n') + result = result:gsub('```lua[\r\n]*', ''):gsub('[\r\n]*```', ''):gsub('^[\r\n]*(.-)[\r\n]*$', '%1'):gsub('\r\n', '\n') assert(expect == result) end end @@ -155,7 +155,20 @@ local <?v?> = collectgarbage() "nil v" TEST [[ -local <!type!> +local type w2l:get_default()[<?type?>] ]] "any type" + +TEST [[ +<?load?>() +]] +[=[ +function load(chunk: string/function [, chunkname: string [, mode: string [, env: table]]]) + -> function, error_message: string + +mode: string + | "b" -- + | "t" -- + | "bt" -- +]=] |