summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-09 01:54:34 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-09 01:55:07 +0800
commit274de6ccd46ec6c589c799dea86a49b8c87b6df2 (patch)
tree09eedb43be4b1d087dac52080a7af0f56acd783a /test
parent4bf314156de18f08406953ae7ed8bf048102a0bb (diff)
downloadlua-language-server-274de6ccd46ec6c589c799dea86a49b8c87b6df2.zip
update tests
Diffstat (limited to 'test')
-rw-r--r--test/tclient/tests/multi-workspace.lua34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/tclient/tests/multi-workspace.lua b/test/tclient/tests/multi-workspace.lua
index dde59322..95b53a0b 100644
--- a/test/tclient/tests/multi-workspace.lua
+++ b/test/tclient/tests/multi-workspace.lua
@@ -78,4 +78,38 @@ lclient():start(function (client)
assert(files.isLibrary(rootUri .. '/share/test.lua') == true)
assert(files.isLibrary(rootUri .. '/lb1/test.lua') == true)
assert(files.isLibrary(rootUri .. '/lb2/test.lua') == true)
+
+ files.setText(rootUri .. '/ws1/unittest.lua', [[
+GLOBAL = 1
+---@class ZAAA
+---@type
+ ]])
+
+ files.setText(rootUri .. '/ws2/unittest.lua', [[
+GLOBAL = 2
+---@class ZBBB
+---@type
+ ]])
+
+ local defs1 = client:awaitRequest('textDocument/definition', {
+ textDocument = {
+ uri = rootUri .. '/ws1/unittest.lua',
+ },
+ position = {
+ line = 0,
+ character = 0,
+ },
+ })
+ assert(#defs1 == 1)
+
+ local defs2 = client:awaitRequest('textDocument/definition', {
+ textDocument = {
+ uri = rootUri .. '/ws2/unittest.lua',
+ },
+ position = {
+ line = 0,
+ character = 0,
+ },
+ })
+ assert(#defs2 == 1)
end)