summaryrefslogtreecommitdiff
path: root/test/crossfile
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-08-20 17:52:06 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-08-20 17:52:06 +0800
commitcb1a412bc7c205c73aec3ef2b1f8f8baf4564fb0 (patch)
tree1175e6ac7bbf1a0747780b8bad6728b8b4da5b00 /test/crossfile
parentfd86458f11ee270884af730a4344ac000265e64e (diff)
downloadlua-language-server-cb1a412bc7c205c73aec3ef2b1f8f8baf4564fb0.zip
stash
Diffstat (limited to 'test/crossfile')
-rw-r--r--test/crossfile/hover.lua21
1 files changed, 9 insertions, 12 deletions
diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua
index 04f7cc02..08773959 100644
--- a/test/crossfile/hover.lua
+++ b/test/crossfile/hover.lua
@@ -68,14 +68,8 @@ function TEST(expect)
local sourcePos = (sourceList[1][1] + sourceList[1][2]) // 2
local hover = core.byUri(sourceUri, sourcePos)
assert(hover)
- if hover.label then
- hover.label = hover.label:gsub('\r\n', '\n')
- end
- if hover.description then
- hover.description = tostring(hover.description)
- end
- assert(eq(hover.label, expect.hover.label))
- assert(eq(hover.description, expect.hover.description))
+ hover = tostring(hover):gsub('\r\n', '\n')
+ assert(eq(hover, expect.hover))
end
TEST {
@@ -87,10 +81,13 @@ TEST {
path = 'b.lua',
content = 'require <?"a"?>',
},
- hover = {
- label = '1 个字节',
- description = [[* [a.lua](file:///a.lua) (搜索路径: `?.lua`)]],
- }
+ hover = [[
+```lua
+1 个字节
+```
+
+---
+* [a.lua](file:///a.lua) (搜索路径: `?.lua`)]],
}
if require 'bee.platform'.OS == 'Windows' then