Skip to content

Commit 4d1a35d

Browse files
committed
pass tests
1 parent 260c249 commit 4d1a35d

File tree

1 file changed

+31
-28
lines changed

1 file changed

+31
-28
lines changed

test/tclient/tests/jump-source.lua

+31-28
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
local lclient = require 'lclient'
2-
local util = require 'utility'
3-
local ws = require 'workspace'
4-
local files = require 'files'
5-
local furi = require 'file-uri'
6-
local fs = require 'bee.filesystem'
1+
local lclient = require 'lclient'
2+
local util = require 'utility'
3+
local ws = require 'workspace'
4+
local files = require 'files'
5+
local furi = require 'file-uri'
6+
local fs = require 'bee.filesystem'
7+
local platform = require 'bee.platform'
78

89
---@async
910
lclient():start(function (client)
@@ -162,28 +163,30 @@ print(D3)
162163
position = { line = 9, character = 7 },
163164
})
164165

165-
assert(util.equal(locations, {
166-
{
167-
uri = 'file:///d%3A/xxx/2.lua',
168-
range = {
169-
start = { line = 0, character = 0 },
170-
['end'] = { line = 0, character = 0 },
166+
if platform.OS == 'Windows' then
167+
assert(util.equal(locations, {
168+
{
169+
uri = 'file:///d%3A/xxx/2.lua',
170+
range = {
171+
start = { line = 0, character = 0 },
172+
['end'] = { line = 0, character = 0 },
173+
}
171174
}
172-
}
173-
}))
174-
175-
local locations = client:awaitRequest('textDocument/definition', {
176-
textDocument = { uri = furi.encode('main.lua') },
177-
position = { line = 10, character = 7 },
178-
})
179-
180-
assert(util.equal(locations, {
181-
{
182-
uri = 'file:///d%3A/test/2.lua',
183-
range = {
184-
start = { line = 0, character = 0 },
185-
['end'] = { line = 0, character = 0 },
175+
}))
176+
177+
local locations = client:awaitRequest('textDocument/definition', {
178+
textDocument = { uri = furi.encode('main.lua') },
179+
position = { line = 10, character = 7 },
180+
})
181+
182+
assert(util.equal(locations, {
183+
{
184+
uri = 'file:///d%3A/test/2.lua',
185+
range = {
186+
start = { line = 0, character = 0 },
187+
['end'] = { line = 0, character = 0 },
188+
}
186189
}
187-
}
188-
}))
190+
}))
191+
end
189192
end)

0 commit comments

Comments
 (0)