summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-07-18 19:29:35 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-07-18 19:29:35 +0800
commit4d1a35d31bf5534a7f717b44ff0a71a2885611f2 (patch)
treec43bd259badd62e545c42ef7d999b03a816931dd
parent260c24942a93888c337f0122fad09e909f7ae384 (diff)
downloadlua-language-server-4d1a35d31bf5534a7f717b44ff0a71a2885611f2.zip
pass tests
-rw-r--r--test/tclient/tests/jump-source.lua59
1 files changed, 31 insertions, 28 deletions
diff --git a/test/tclient/tests/jump-source.lua b/test/tclient/tests/jump-source.lua
index dd7666c3..84a4dcd5 100644
--- a/test/tclient/tests/jump-source.lua
+++ b/test/tclient/tests/jump-source.lua
@@ -1,9 +1,10 @@
-local lclient = require 'lclient'
-local util = require 'utility'
-local ws = require 'workspace'
-local files = require 'files'
-local furi = require 'file-uri'
-local fs = require 'bee.filesystem'
+local lclient = require 'lclient'
+local util = require 'utility'
+local ws = require 'workspace'
+local files = require 'files'
+local furi = require 'file-uri'
+local fs = require 'bee.filesystem'
+local platform = require 'bee.platform'
---@async
lclient():start(function (client)
@@ -162,28 +163,30 @@ print(D3)
position = { line = 9, character = 7 },
})
- assert(util.equal(locations, {
- {
- uri = 'file:///d%3A/xxx/2.lua',
- range = {
- start = { line = 0, character = 0 },
- ['end'] = { line = 0, character = 0 },
+ if platform.OS == 'Windows' then
+ assert(util.equal(locations, {
+ {
+ uri = 'file:///d%3A/xxx/2.lua',
+ range = {
+ start = { line = 0, character = 0 },
+ ['end'] = { line = 0, character = 0 },
+ }
}
- }
- }))
-
- local locations = client:awaitRequest('textDocument/definition', {
- textDocument = { uri = furi.encode('main.lua') },
- position = { line = 10, character = 7 },
- })
-
- assert(util.equal(locations, {
- {
- uri = 'file:///d%3A/test/2.lua',
- range = {
- start = { line = 0, character = 0 },
- ['end'] = { line = 0, character = 0 },
+ }))
+
+ local locations = client:awaitRequest('textDocument/definition', {
+ textDocument = { uri = furi.encode('main.lua') },
+ position = { line = 10, character = 7 },
+ })
+
+ assert(util.equal(locations, {
+ {
+ uri = 'file:///d%3A/test/2.lua',
+ range = {
+ start = { line = 0, character = 0 },
+ ['end'] = { line = 0, character = 0 },
+ }
}
- }
- }))
+ }))
+ end
end)