summaryrefslogtreecommitdiff
path: root/server/test
diff options
context:
space:
mode:
Diffstat (limited to 'server/test')
-rw-r--r--server/test/signature/init.lua22
1 files changed, 15 insertions, 7 deletions
diff --git a/server/test/signature/init.lua b/server/test/signature/init.lua
index bc3713d7..89863f12 100644
--- a/server/test/signature/init.lua
+++ b/server/test/signature/init.lua
@@ -11,15 +11,18 @@ function TEST(script)
local vm = matcher.vm(ast)
assert(vm)
local hovers = matcher.signature(vm, pos)
- assert(hovers)
- local hover = hovers[#hovers]
+ if hovers then
+ local hover = hovers[#hovers]
- local label = hover.label:gsub('^[\r\n]*(.-)[\r\n]*$', '%1'):gsub('\r\n', '\n')
- expect.label = expect.label:gsub('^[\r\n]*(.-)[\r\n]*$', '%1'):gsub('\r\n', '\n')
- local arg = hover.argLabel
+ local label = hover.label:gsub('^[\r\n]*(.-)[\r\n]*$', '%1'):gsub('\r\n', '\n')
+ expect.label = expect.label:gsub('^[\r\n]*(.-)[\r\n]*$', '%1'):gsub('\r\n', '\n')
+ local arg = hover.argLabel
- assert(expect.label == label)
- assert(expect.arg == arg)
+ assert(expect.label == label)
+ assert(expect.arg == arg)
+ else
+ assert(expect == nil)
+ end
end
end
@@ -66,3 +69,8 @@ function *string:sub(i: integer [, j: integer(-1)])
]],
arg = 'i: integer'
}
+
+TEST [[
+(''):sub(1)@
+]]
+(nil)