summaryrefslogtreecommitdiff
path: root/test/crossfile/diagnostic.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/crossfile/diagnostic.lua')
-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