From 0d56d8653a28f12601deba8b1a137557cf42f6cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 21 Dec 2018 18:08:13 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=B7=B3=E8=BF=87=E5=8F=AF=E9=80=89?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=B2=A1=E6=9C=89=E7=AB=8B=E5=8D=B3=E5=85=B3?= =?UTF-8?q?=E9=97=AD=E5=8F=82=E6=95=B0=E6=8F=90=E7=A4=BA=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/test/signature/init.lua | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'server/test/signature') 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) -- cgit v1.2.3