summaryrefslogtreecommitdiff
path: root/test/crossfile
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-08-11 17:57:22 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-08-11 17:57:29 +0800
commit5e5a1b2ebb103625bbbb686ab31abc11a78e9d73 (patch)
tree8140d6f9c04a51476e558a9b7fa661a068d6c49a /test/crossfile
parentcd370225fc4eaf6e2f6baadfb5a8501943c86783 (diff)
downloadlua-language-server-5e5a1b2ebb103625bbbb686ab31abc11a78e9d73.zip
cleanup tests
Diffstat (limited to 'test/crossfile')
-rw-r--r--test/crossfile/diagnostic.lua24
1 files changed, 19 insertions, 5 deletions
diff --git a/test/crossfile/diagnostic.lua b/test/crossfile/diagnostic.lua
index e270d3da..1acf3fe2 100644
--- a/test/crossfile/diagnostic.lua
+++ b/test/crossfile/diagnostic.lua
@@ -58,20 +58,26 @@ function TEST(datas)
local results = {}
+ local origins = {}
for _, data in ipairs(datas) do
local uri = furi.encode(data.path)
core(uri, false, function (result)
- results[#results+1] = {
- result.start,
- result.finish,
- uri,
- }
+ if result.code == datas.code then
+ results[#results+1] = {
+ result.start,
+ result.finish,
+ uri,
+ }
+ end
+ origins[#origins+1] = result
end)
end
+ assert(datas.code, 'Need code')
assert(founded(targetList, results))
end
TEST {
+ code = 'different-requires',
{
path = 'f/a.lua',
content = '',
@@ -87,6 +93,7 @@ TEST {
}
TEST {
+ code = 'different-requires',
{
path = 'f/a.lua',
content = '',
@@ -106,6 +113,7 @@ TEST {
}
TEST {
+ code = 'different-requires',
{
path = 'a.lua',
content = '',
@@ -125,6 +133,7 @@ TEST {
}
TEST {
+ code = 'different-requires',
{
path = 'a/init.lua',
content = '',
@@ -144,6 +153,7 @@ TEST {
}
TEST {
+ code = 'invisible',
{ path = 'a.lua', content = [[
---@class A
---@field package x string
@@ -156,6 +166,7 @@ TEST {
}
TEST {
+ code = 'invisible',
{ path = 'a.lua', content = [[
---@class A
---@field package x string
@@ -169,6 +180,7 @@ TEST {
}
TEST {
+ code = 'duplicate-doc-field',
{ path = 'a.lua', content = [[
---@class A
---@field <!x!> number
@@ -180,6 +192,7 @@ TEST {
}
TEST {
+ code = 'duplicate-set-field',
{ path = 'a.lua', content = [[
---@class A
local mt
@@ -197,6 +210,7 @@ TEST {
}
TEST {
+ code = 'duplicate-set-field',
{ path = 'a.lua', content = [[
---@class A
local mt